class Expeditor::RichFuture
Public Instance Methods
executed?()
click to toggle source
# File lib/expeditor/rich_future.rb, line 40 def executed? not unscheduled? end
fail(e)
click to toggle source
Calls superclass method
# File lib/expeditor/rich_future.rb, line 32 def fail(e) super(e) end
get()
click to toggle source
# File lib/expeditor/rich_future.rb, line 6 def get wait if rejected? raise reason else value end end
get_or_else(&block)
click to toggle source
# File lib/expeditor/rich_future.rb, line 15 def get_or_else(&block) wait if rejected? block.call else value end end
safe_execute(*args)
click to toggle source
Calls superclass method
# File lib/expeditor/rich_future.rb, line 44 def safe_execute(*args) if args.empty? begin execute rescue Exception => e fail(e) end else super(*args) end end
safe_fail(e)
click to toggle source
# File lib/expeditor/rich_future.rb, line 36 def safe_fail(e) fail(e) unless complete? end
safe_set(v)
click to toggle source
# File lib/expeditor/rich_future.rb, line 28 def safe_set(v) set(v) unless complete? end
set(v)
click to toggle source
# File lib/expeditor/rich_future.rb, line 24 def set(v) complete(true, v, nil) end