Module: Is::Async
- Included in:
- Core::Async::Collection, Core::Async::Collection, Core::Async::Enumerator, Core::Async::Reactor
- Defined in:
- lib/is/async.rb
Overview
- public
-
Makes Ruby objects async-aware.
Instance Method Summary collapse
-
#async ⇒ Object
- public
-
Call behavior asychronously, returning a future.
Instance Method Details
#async ⇒ Object
- public
-
Call behavior asychronously, returning a future.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/is/async.rb', line 14 def async if block_given? task = ::Async::Reactor.run { |current| begin yield ensure current.yield end } Core::Async::Future.new(task) else Core::Async::Wrapper.new(self) end end |