Module: ZeevexConcurrency::Delayed::ConvenienceMethods

Included in:
ZeevexConcurrency
Defined in:
lib/zeevex_concurrency/delayed.rb

Instance Method Summary collapse

Instance Method Details

#delay(*args, &block) ⇒ Object



18
19
20
# File 'lib/zeevex_concurrency/delayed.rb', line 18

def delay(*args, &block)
  ZeevexConcurrency::Delay.__send__(:create, *args, &block)
end

#delay?(obj) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/zeevex_concurrency/delayed.rb', line 26

def delay?(obj)
  obj.is_a?(ZeevexConcurrency::Delay)
end

#delayed?(obj) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/zeevex_concurrency/delayed.rb', line 22

def delayed?(obj)
  obj.is_a?(ZeevexConcurrency::Delayed)
end

#future(*args, &block) ⇒ Object



10
11
12
# File 'lib/zeevex_concurrency/delayed.rb', line 10

def future(*args, &block)
  ZeevexConcurrency::Future.__send__(:create, *args, &block)
end

#future?(obj) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/zeevex_concurrency/delayed.rb', line 34

def future?(obj)
  obj.is_a?(ZeevexConcurrency::Future)
end

#promise(*args, &block) ⇒ Object



14
15
16
# File 'lib/zeevex_concurrency/delayed.rb', line 14

def promise(*args, &block)
  ZeevexConcurrency::Promise.__send__(:create, *args, &block)
end

#promise?(obj) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/zeevex_concurrency/delayed.rb', line 30

def promise?(obj)
  obj.is_a?(ZeevexConcurrency::Promise)
end