]> Sergey Matveev's repositories - public-inbox.git/commit
standardize timer-related event-loop code
authorEric Wong <e@80x24.org>
Tue, 24 May 2016 03:41:51 +0000 (03:41 +0000)
committerEric Wong <e@80x24.org>
Tue, 24 May 2016 04:12:03 +0000 (04:12 +0000)
commit74bbc3da398d00ba12e9294e360ad177ab2061ed
tree964f723b1072e848c4db177ab43ba5461c657e89
parente330b2eec13ebda99a7e2981375dee4fe397f14a
standardize timer-related event-loop code

Standardize the code we have in place to avoid creating too many
timer objects.  We do not need exact timers for things that don't
need to be run ASAP, so we can play things fast and loose to avoid
wasting power with unnecessary wakeups.

We only need two classes of timers:

* asap - run this on the next loop tick, after operating on
  @Danga::Socket::ToClose to close remaining sockets

* later - run at some point in the future.  It could be as
  soon as immediately (like "asap"), and as late as 60s into
  the future.

In the future, we support an "emergency" switch to fire "later"
timers immediately.
lib/PublicInbox/EvCleanup.pm [new file with mode: 0644]
lib/PublicInbox/HTTP.pm
lib/PublicInbox/HTTPD/Async.pm
lib/PublicInbox/NNTP.pm