Re: manually-invoked watchers

[email protected] (Joshua N Pritikin) Wed, 21 Apr 2004 11:52:24 +0530
Newsgroups perl.loop
Message-ID <[email protected]>
On Tue, Apr 20, 2004 at 09:05:17PM +0100, Zefram wrote:
> I have a need for a type of watcher for which events are only generated
> manually.  I want this for event types along the lines of "redraw
> required": it's generated as a result of internal program logic, but
> I want it to be subject to priority queuing.  I'm surprised that there
> isn't already a "non-specific" watcher class, one that never automatically
> generates an event.

What's wrong with a var watcher?

> (Digression: a bug report:
> 
> Note that "now" works perfectly well on a stopped watcher.  There's a
> related bug: if the stopped event has no callback set, then a SEGV
> results.  Try that out by changing the setup of $my_watcher above to
> 
> 	my $my_watcher = Event->var(parked => 1);
> 
> I'm not sure what the semantics of "now" on a stopped watcher ought to be.
> The two obvious candidates are: (a) act as now, but balk if no callback
> is set; (b) silently do nothing if the watcher is stopped.  Option (b)
> would be convenient for the usage I discuss below, but I don't know how
> "now" is being used by other people.  Maybe both versions are useful.
> 
> End digression.)

Thanks for the report.  I fixed this bug in my code.

-- 
A new cognitive theory of emotion, http://openheartlogic.org
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAhhMgqcqnlKSmC70RAmQHAKCk9+iMk42RBYAPCqpJmJ2CY0g9/QCfYQPK
r2KLTkeG3slAqMsnjpsR3I4=
=yuT2
-----END PGP SIGNATURE-----