Method: Concurrent::Promises::Future#run
- Defined in:
- lib/concurrent-ruby/concurrent/promises.rb
#run(run_test = method(:run_test)) ⇒ Future
Allows to use futures as green threads. The receiver has to evaluate to a future which represents what should be done next. It basically flattens indefinitely until non Future values is returned which becomes result of the returned future. Any encountered exception will become reason of the returned future.
1199 1200 1201 |
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1199 def run(run_test = method(:run_test)) RunFuturePromise.new_blocked_by1(self, @DefaultExecutor, run_test).future end |