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


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


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