Do'h! Ok ... I see my problem. In my IO callback there's a loop around
the socket accept, so it's just not returning to the Event::loop, and
since most of the functionality is in that IO callback, it was hard to
catch earlier.
Thanks for bearing with me,
John
John Christian w
d!!!");
});
$tmp = {
who => $p{who},
info => { %p },
jid => $jid,
timer => $timer
};
# push(@Jobs, $tmp);
$JobsByJID{$jid} = $tmp;
# at this point, if I call Event::all_watchers, it does return
# watchers for timers and the io callback, repo
ted
(even with PRIO_HIGH and a hardcoded short interval).
Is there anything more I may need to do for the timers to be active?
Also, if there is more documentation available in addition to the
perldoc, that would be very helpful.
Thanks,
John
I have no idea if this is related, but take a look at bugid 20011218.001
at bugs.perl.org. I got a memory leak in perl5.6.0 just by using
a local-ized $_ . Your memory leak may have nothing whatsoever to do
with Event.
It's fixed in the 5.7 tree, but still broken in 5.6.1.
Cheers,
Hi
This is a question I *think* I know the answer to, but I'm not sure.
I have an event loop with 3 watchers of the timer flavor. The watchers
all point to the same function for their callback. There are variables
scoped to the function with 'my'. There is a value that is passed in
with the priv
Hi
> >>>>> "JS" == John Saylor <[EMAIL PROTECTED]> writes:
> JS> I want to use Event.pm to increase performance by doing a
> JS> parallel-ism thing.
> JS> Any suggestions or pointers? If my description is too generic let
> JS> me
Hi
I want to use Event.pm to increase performance by doing a parallel-ism
thing. Basically, rather than run through an array member by member,
I'll split- er splice the array into smaller arrays and process the
smaller arrays all at the same time, each with it's own event handler.
Right now I am
re pre-existing solutions?
Thanks,
John Salmon
enced major frustration with OO documentation that
does not clearly distinguish what's meant for implementors of
inherited classes and what's meant for class users (the JDK comes to
mind). Please do provide this kind of guidance where it makes sense.
Cheers,
John Salmon
Please feel free to copy my script to anywhere that seems useful, e.g.,
the demo directory, somewhere in the docs, etc.
Cheers,
John
me($now), " Next: ", $next, "\n";
Joshua> $w->interval($next);
Joshua>});
Joshua>loop();
Bingo! That one works. Thanks. So the bottom line is: you must use
the interval attribute and the interval method if the timer is going
to be reused. Maybe this observation is worth a line in the pod?
Cheers,
John Salmon
constructor was causing me trouble.
So I tried the following constructor instead:
$w = Event->timer(at => Event::time() + 1);
Then I got:
[jsalmon@gw]$ ./ev.pl
Now: Wed Dec 15 09:06:43 1999 Next: Wed Dec 15 09:06:49 1999
Event: trapped error in '?? ev.pl:5': Repeating timer with no interval at
/usr/lib/perl5/site_perl/5.005/i386-linux/Event.pm line 145
Other ideas?
Thanks,
John Salmon
hat I'm trying to do:
#!/usr/local/bin/perl
use Event qw( loop );
$w = Event->timer(after => 1);
$w->cb(sub {
print scalar localtime, "\n";
$w->after(rand(10.));
$w->again;
});
loop();
Can anyone suggest a better approach for this kind of problem?
Thanks,
John Salmon
13 matches
Mail list logo