Permalink
Browse files

Fix bug where child nodes would be run on failure for EM#defered nodes

  • Loading branch information...
1 parent 21f55c1 commit 08fea43a7d6eff2fadae8def15b85c044d027940 @mloughran committed Nov 14, 2009
Showing with 9 additions and 10 deletions.
  1. +9 −10 lib/noodler/node.rb
View
@@ -54,16 +54,15 @@ def run_async(input)
end
def run_sync(input)
- EM.defer \
- lambda {
- begin
- @output = @strategy.call(self, input);
- rescue => e
- puts "exception caught in thread - propagating back"
- fail e
- end
- },
- lambda { EM.next_tick(method(:run_children)) }
+ EM.defer do
+ begin
+ @output = @strategy.call(self, input)
+ EM.next_tick(method(:run_children))
+ rescue => e
+ puts "exception caught in thread - propagating back"
+ fail e
+ end
+ end
end
def run_children

0 comments on commit 08fea43

Please sign in to comment.