Collects returning value and sets the ResolvableFuture in the Envelope or error on failure.
Instance Attribute Summary collapseA new instance of SetResults.
Returns a new instance of SetResults.
10 11 12 13
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/sets_results.rb', line 10 def initialize(core, subsequent, core_options, error_strategy) super core, subsequent, core_options @error_strategy = Match! error_strategy, :just_log, :terminate!, :pause! endInstance Attribute Details #error_strategy ⇒ undocumented
8 9 10
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/sets_results.rb', line 8 def error_strategy @error_strategy endInstance Method Details #on_envelope(envelope) ⇒ undocumented
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/sets_results.rb', line 15 def on_envelope(envelope) result = pass envelope if result != MESSAGE_PROCESSED && !envelope.future.nil? envelope.future.fulfill result log(DEBUG) { "finished processing of #{envelope.message.inspect}"} end nil rescue => error log ERROR, error case error_strategy when :terminate! terminate! when :pause! behaviour!(Pausing).pause!(error) when :just_log else raise end envelope.future.reject error unless envelope.future.nil? end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4