signal() is only an interface to the underlaying signals of your OS. It's limited to certain signals and you cannot pass parameters to your callbacks.
My implementations usually look something like: void register_event(string event_name, function cb) void fire_event(string event_name, mixed ... args)
You are allowed to register multiple callbacks for each event and each callback is called every time that event is fired.
/ Marcus Agehall (Scanian)
Previous text:
2004-05-24 10:50: Subject: Re: Events in pike?
Hi,
But before I spend any time on it, I'd like some input on the matter. For instance, is it useful enough to write put in Pike? Would you like it to work in some special way? How do you normally implement events in Pike?
What's the difference with signal() ?
/ David
/ Brevbäraren