File: //usr/local/rvm/gems/ruby-2.7.4/doc/concurrent-ruby-1.1.9/ri/Concurrent/Promises/Future/run-i.ri
U:RDoc::AnyMethod[iI"run:ETI"%Concurrent::Promises::Future#run;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"\Allows to use futures as green threads. The receiver has to evaluate to a future which ;TI"^represents what should be done next. It basically flattens indefinitely until non Future ;TI"_values is returned which becomes result of the returned future. Any encountered exception ;TI"/will become reason of the returned future.;To:RDoc::Markup::BlankLine o;
; [I"@return [Future] ;TI"#@param [#call(value)] run_test;To:RDoc::Markup::Verbatim; [
I"Lan object which when called returns either Future to keep running with
;TI"4or nil, then the run completes with the value.
;TI"KThe run_test can be used to extract the Future from deeper structure,
;TI"Gor to distinguish Future which is a resulting value from a future
;TI"+which is suppose to continue running.
;T:@format0o;
; [I"
@example;To;; [
I"body = lambda do |v|
;TI" v += 1
;TI"- v < 5 ? Promises.future(v, &body) : v
;TI" end
;TI"0Promises.future(0, &body).run.value! # => 5;T;
0:
@fileI"/lib/concurrent-ruby/concurrent/promises.rb;T:0@omit_headings_from_table_of_contents_below000[ I"#(run_test = method(:run_test));T@'FI"Future;TcRDoc::NormalClass00