AnyEvent:HTTP::ACTIVE - but how many are events are running?
James Bromberger
james at rcpt.to
Thu Aug 25 11:14:51 CEST 2011
Hello all,
I have a callback I'm using with AE:HTTP, and I wanted to print out some
debug info showing me the number of ACTIVE connections, and the number
of running events. I can easily use AnyEvent::HTTP::ACTIVE for the
active session number, and the doco tells me ACTIVE "/is not the number
of currently running requests/", but what variable would expose the
number of events that are (potentially) queued up?
For example I have 50 URLs queued to the same host, then ACTIVE will
return MAX_PER_HOST (default 4). But I'd like to see my 50 being counted
down.... (using AE::HTTP 2.13)
I have a fairly long-running callback taking sometimes up to 7 seconds
to complete. I'm trying to see if I can/should avoid threads (Perl
5.10). Is Coro recommended/preferred over spawning off a thread to deal
with callback?
I'm wondering if there's a good way for me to enqueue more events when
the number of running events starts to get low (before it hits zero).
This would mean creating more events within my callback. Is this OK, or
insane?
Thanks
James
--
/Mobile:/ +61 422 166 708, /Email:/ james_AT_rcpt.to
PLUG President 2011: http://www.plug.org.au <http//www.plug.org.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20110825/64c3b882/attachment.htm>
More information about the anyevent
mailing list