Module: Kernel

Defined in:
lib/future.rb,
lib/promise.rb

Instance Method Summary collapse

Instance Method Details

#future(&block) ⇒ Object

Create a new future

Examples:

x = future { 3 + 3 }


46
47
48
# File 'lib/future.rb', line 46

def future(&block)
  Future.new(block)
end

#promise(&block) ⇒ Object

Create a new promise

Examples:

x = promise { 3 + 3 }


51
52
53
# File 'lib/promise.rb', line 51

def promise(&block)
  Promise.new(block)
end