On Mon, Jan 31, 2000 at 01:08:28PM +0100, [EMAIL PROTECTED] wrote:
> 1) Event manages watcher objects internally. That's why there is no
> urgent need to manage them yourself. On the other hand, if you want to
> do this, it is possible. As a side effect of this, one can have a
> watcher object that is already terminated by cancel(). Now, the doc
> says:
>
> "If an attempt is made to use $watcher after calling cancel() then an
> exception will be thrown."
>
> Is this still true? For example, I could do the following without
> causing an exception:
>
> $w=Event->io;
> $w->cancel;
> print $w->prio;
>
> May be this is not the usage mentioned in the quoted doc text?
>
> Further more, I could call "$w->again()" to reactivate the watcher and
> it WORKS after that (contrary to the docs).
Ugh!
> In the example above, it seems to me that calling $w->cancel() became
> synonym to calling $w->stop(), am I right?
I guess the destruction protocol changed so many times that I didn't
plaster over all of the old nail holes. I'm put in a fix to check for
this case. Cancelled watchers are no longer valid except for read-only
type operations.
> Further more, one can check if a watcher was cancelled - by calling
> is_active(). So I suggest to note this in the doc as well, e.g.:
Do you want an is_cancelled() method? I could add that, but it didn't
seem important.
> 2) The doc says: "MOST constructors return already active watchers." And
> at another place: "When created, watcher objects ARE "started" and ARE
> waiting for events." It is not completely clear if there are watchers
> which are NOT active immediately after construction. If so, I suggest to
> include a list of them.
Yes, I added a 'parked' option (as discussed earlier) to the constructor
and updated the documentation.
> 3) loop() only runs if there is an (active?) watcher, it immediately
> terminates if not. But because it is possible to construct watchers
> without all necessary data which are active nevertheless, loop() RUNS
> the following way:
>
> use Event;
> Event->io;
> Event::loop;
>
> This is a complete, valid script. I think this should be prevented.
> (This script blocks my perl debugger. At least.)
>
> More, is it prevented that someone suspends all his watchers and ends up
> with such a dead loop, too?
I put in a check for that and added tests. I hope this doesn't cause
too much breakage of existing code.
> 4) "All watchers support at least the following attributes: cb, hits,
> prio, desc, repeat, debug, and reentrant." As I understood, the new data
> attribute is a basic one, but is not mentioned here. And what about
> async, max_cb_tm, nice and running?
Updated. Thanks.
> 5) "got is available in the callback of watchers with poll.", but got is
> not documented for var watchers which own poll as well.
Corrected. Thanks.
> 6) var watchers have a poll attribute which is described with valid
> values r, w, e and t.
Where do you see this? FYI, var watchers only respect the R & W flags.
> And, because they have no timeout attribute, "t"?
Timeout is not a problem to add, but no one has requested it yet.
> 7) The hard attribute is documented for timers. This is clear. It is
> documented for io watchers as well - I suppose it influences the timeout
> calculation there? If so, it should be an attribute of all watchers
> which have a timeout setting - but inactivity has not.
The inactivity watcher is experimental. It is explicitly documented as
such in my copy of Event.
> 8) Could you provide a list of which attribute settings are mandatory
> for the certain watcher types?
Here is what I wrote:
=item $watcher->start
Activate the watcher. Watchers refuse to C<start()> without sufficient
configuration information to generate events. Constructors always
invoke C<start()> unless the C<parked=>1> option is requested. You
will need to set the parked option if you preallocate unconfigured
watchers.
Do you still want all the specifics? Isn't it too much detail?
> 9) If I install a watcher and delay the call of loop(), what about
> events arriving in the meantime?
I don't want to address this question until the Win32 port is done.
Thanks for all your carefully research! I'll upload a new version
shortly.
--
"Does `competition' have an abstract purpose?"
via, but not speaking for Deutsche Bank