Class: BasicObject
- Defined in:
- lib/fibril/control.rb,
lib/fibril/core.rb,
lib/fibril/basic_object.rb
Overview
Create a new future
Instance Method Summary collapse
-
#async ⇒ Object
An asynchronous proxy.
- #await(*args, &block) ⇒ Object
-
#fasync ⇒ Object
An asynchronous proxy.
-
#ffuture(&blk) ⇒ Object
Create a new forked future.
-
#fibril(*guard_names, &block) ⇒ Object
This method has two methods of use.
- #future(&blk) ⇒ Object
- #tick(*guard_names, **args) ⇒ Object
Instance Method Details
#async ⇒ Object
An asynchronous proxy. Executes any methods invoked via proxy on target in a separate thread
9 10 11 |
# File 'lib/fibril/basic_object.rb', line 9 def async @async_proxy ||= ::Fibril::AsyncProxy.new(self) end |
#await(*args, &block) ⇒ Object
296 297 298 |
# File 'lib/fibril/core.rb', line 296 def await(*args, &block) ::Fibril.current.await(*args, &block) end |
#fasync ⇒ Object
An asynchronous proxy. Executes any methods invoked via proxy on target in a separate fork
16 17 18 |
# File 'lib/fibril/basic_object.rb', line 16 def fasync @fasync_proxy ||= ::Fibril::FAsyncProxy.new(self) end |
#ffuture(&blk) ⇒ Object
Create a new forked future
17 18 19 |
# File 'lib/fibril/control.rb', line 17 def ffuture(&blk) return ::Fibril::FFuture.new(&blk) end |
#fibril(*guard_names, &block) ⇒ Object
This method has two methods of use. Either
-
call with block to create a new fibril
-
call without block to create a fibril proxy. Any methods invoked on a proxy are executed on the target from
within a new Fibril
284 285 286 287 288 289 290 |
# File 'lib/fibril/core.rb', line 284 def fibril(*guard_names, &block) if block_given? Fibril(*guard_names, &block) else ::Fibril::FibrilProxy.new(self, *guard_names) end end |