Hmm, that sounds interesting, but I think I would leave that up to the application. Ie, if the application wants to, it can fire two events instead of one. The fire_event() method could return an array with the results from the callbacks. This way, the application can test the result from all callbacks, to see if they failed or not.
/ Marcus Agehall (Scanian)
Previous text:
2004-05-24 17:33: Subject: Re: Events in pike?
On Mon, May 24, 2004 at 05:26:57PM +0200, Alexander Demenshin wrote:
it has two phases which allow you to choose wether the callback is run before or after the event happens.
Huh? How is this possible? How do you know _which_ event happens to call callback _before_ it happens?
simple. the event knows. every event first announces its intention to run, checks the results of any callbacks and if they are ok, it runs.
permission checks are a good example. they need to be done before the protected object is accessed (which is the actual event in question)
greetings, martin.
/ Brevbäraren