 
     # Give other (Node) events a chance to process
     @running = true
-    process.nextTick =>
+    setImmediate =>
       @running = false
       unless @active
         @emit("done")

  # in the next tick, but makes sure waiters block for the function.
  next: (fn)->
    ++@expected
    process.nextTick =>
      --@expected
      try
        fn()


    # Someone (us) just started paying attention, start processing events
    if @listeners.length == 1
      setImmediate =>
        if @active
          @active._eventQueue.resume()
          @run()
