Class: Contr::Matcher::Async
Instance Method Summary collapse
-
#initialize ⇒ Async
constructor
A new instance of Async.
- #match ⇒ Object
Constructor Details
#initialize ⇒ Async
Returns a new instance of Async.
6 7 8 9 10 11 12 |
# File 'lib/contr/matcher/async.rb', line 6 def initialize(*) super @async = true @ok_rules = Concurrent::Array.new @failed_rules = Concurrent::Array.new end |
Instance Method Details
#match ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/contr/matcher/async.rb', line 14 def match contract_future = main_pool.future do contract_failed = rules_pool ? check_with_async_rules : check_with_sync_rules dump_state! if contract_failed end contract_future.wait! if inline? end |