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

Instance Method Details

#asyncObject

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

#fasyncObject

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

  1. call with block to create a new fibril

  2. 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

#future(&blk) ⇒ Object



10
11
12
# File 'lib/fibril/control.rb', line 10

def future(&blk)
  return ::Fibril::Future.new(&blk)
end

#tick(*guard_names, **args) ⇒ Object



292
293
294
# File 'lib/fibril/core.rb', line 292

def tick(*guard_names, **args)
  ::Fibril::TickProxy.new(self, *guard_names, **args)
end