rehanift/engine.js — pull request #10 by rubymaverick (2012-04-28 17:54:12+00:00)
Title: Emit an 'end' event on task when no more 'eval' and 'output' events can be emitted

I think it would be helpful to be able to listen on task for an 'end' event to make sure any cleanup/callbacks are run after no more 'output' and 'eval' events can be emitted. Without the 'end' event, you have to do some weird setTimeout stuff to make sure you wait long enough till after the 'eval' event was emitted to make sure any lingering 'output' events are recorded.

I'm not sure if this is the best way to go about this problem. I added a test and a little something to the README. Let me know of a possible better approach.