Class: Eventsimple::EventDispatcher::ReactorSet

Inherits:
Object
  • Object
show all
Defined in:
lib/eventsimple/event_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.



80
81
82
83
# File 'lib/eventsimple/event_dispatcher.rb', line 80

def initialize
  @sync = []
  @async = []
end

Instance Attribute Details

#asyncObject (readonly)

Returns the value of attribute async.



78
79
80
# File 'lib/eventsimple/event_dispatcher.rb', line 78

def async
  @async
end

#syncObject (readonly)

Returns the value of attribute sync.



78
79
80
# File 'lib/eventsimple/event_dispatcher.rb', line 78

def sync
  @sync
end

Instance Method Details

#add_async(reactors) ⇒ Object



89
90
91
# File 'lib/eventsimple/event_dispatcher.rb', line 89

def add_async(reactors)
  @async |= reactors
end

#add_sync(reactors) ⇒ Object



85
86
87
# File 'lib/eventsimple/event_dispatcher.rb', line 85

def add_sync(reactors)
  @sync |= reactors
end