Module: Circuitry::Concerns::Async

Included in:
Publisher, Subscriber
Defined in:
lib/circuitry/concerns/async.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#asyncObject

Returns the value of attribute async.



10
11
12
# File 'lib/circuitry/concerns/async.rb', line 10

def async
  @async
end

Class Method Details

.included(base) ⇒ Object



12
13
14
# File 'lib/circuitry/concerns/async.rb', line 12

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#async?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/circuitry/concerns/async.rb', line 45

def async?
  ![nil, false].include?(async)
end

#process_asynchronously(&block) ⇒ Object



26
27
28
# File 'lib/circuitry/concerns/async.rb', line 26

def process_asynchronously(&block)
  send(:"process_via_#{async}", &block)
end