NodeFly/node-nodefly-gcinfo — pull request #3 by bnoordhuis (2013-11-01 12:08:34+00:00)
Title: src: don't round-trip through thread pool

Before this commit, a dummy uv_work_t request was used to force the
event loop to cycle. It works but it means an unnecessary round-trip
through the thread pool, which is a fairly constrained resource to start
with.

Rewrite it to use a uv_idle_t handle paired with a queue of batons that
get dispatched in the idle callback. A future optimization is to hand
off the pending batons in a single call to JS land rather than making
a callback per baton.

Fix a minor resource leak due to a missing HandleScope while we're here.

(+2 code cleanup commits.)

Suggested reviewer: @AndrewMartens?