devinus/poolboy — pull request #50 by arjan (2014-05-02 21:40:39+00:00)
Title: Use workers as a stack, not a queue

Instead of round-robin of worker selection from the pool, we now use a
LIFO principle to select a worker. Rationale behind this is that 'hot'
workers are better workers to use than cold workers.

For instance, in database applications, worker processes might decide to
close their connection after being idle for a while (see devinus'
comment on https://github.com/devinus/poolboy/issues/30). Doing
round-robin selection would cause a new database connection to be
established each time for each new worker even when the pressure on the
pool is low (e.g. with just 1 process doing sequential db queries).