Class: Evey::Dispatcher::ReactorSet

Inherits:
Object
  • Object
show all
Defined in:
lib/evey/dispatcher.rb

Overview

Contains sync and async reactors. Used to:

  • store reactors via Rules#register

  • return a set of matching reactors with Rules#for

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReactorSet

Returns a new instance of ReactorSet.



83
84
85
86
# File 'lib/evey/dispatcher.rb', line 83

def initialize
  @sync = Set.new
  @async = Set.new
end

Instance Attribute Details

#asyncObject (readonly)

Returns the value of attribute async.



81
82
83
# File 'lib/evey/dispatcher.rb', line 81

def async
  @async
end

#syncObject (readonly)

Returns the value of attribute sync.



81
82
83
# File 'lib/evey/dispatcher.rb', line 81

def sync
  @sync
end

Instance Method Details

#add_async(reactors) ⇒ Object



92
93
94
# File 'lib/evey/dispatcher.rb', line 92

def add_async(reactors)
  @async += reactors
end

#add_sync(reactors) ⇒ Object



88
89
90
# File 'lib/evey/dispatcher.rb', line 88

def add_sync(reactors)
  @sync += reactors
end