AnyEvent driver for Prima
Max Maischein
corion at corion.net
Mon Dec 19 21:31:06 CET 2016
Hello all,
I have news of progress, and most of it is good.
> In the github repo, Prima implements now the following:
>
> - Prima::File->fd() (along with the existing Prima::File->file)
>
> - Prima::Timer's onTick event will guarantee that it won't be triggered after stop() call (so you won't need destroy() to be bulletproof)
Using that development version, most of the AnyEvent self-tests pass
(see the github repo, which includes them). The one test that fails is
the timer test number 05. Marc, correct me if I'm wrong: I think this
test tests that a timer that is scheduled and immediately forgotten does
not fire:
my $timer1 = AnyEvent->timer (after => 0.1, cb => sub { print "ok
5\n"; $cv->broadcast });
print "ok 3\n";
# second timer
AnyEvent->timer (after => 0.01, cb => sub { print "not ok 5\n" });
print "ok 4\n";
$cv->wait;
In my testing with an onDestroy handler for Prima, I see that the
onDestroy handler for the second timer is also called in the main loop
($cv->wait). This means to me that something keeps the second timer
alive, but from what I can test, the reference is not in
AnyEvent::Impl::Prima...
again, other than this one failure, everything else is skipped
(Windows+threads joy) or works.
> - Prima::Component->idle_message method added. Calling this method will insert the component (once) to the global idle list,
> and when the loop becomes idle, it's onIdle callback will be called, once, and the the component will be removed from the list.
> However I'm note sure though that I've got the idle semantics right, so if you think that there's something that can be made better,
> do say.
I haven't added that feature yet, so no comment here ;)
-max
More information about the anyevent
mailing list