Sounds similar to the simple event system I added in Sitebuilder some years ago. There were three callbacks: before, after and cancel. Whenever a handled event was going to happen, the "before" callbacks were called. Then the event took place. Then the "after" callbacks were called if the event finished successfully; otherwise the "cancel" callbacks were called.
/ Leif Stensson, Lysator
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