Class: RubyEventStore::Subscriptions::ThreadSubscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/subscriptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeThreadSubscriptions

Returns a new instance of ThreadSubscriptions.


52
53
54
55
# File 'lib/ruby_event_store/subscriptions.rb', line 52

def initialize
  @local  = ThreadLocalSubscriptions.new
  @global = ThreadGlobalSubscriptions.new
end

Instance Attribute Details

#globalObject (readonly)

Returns the value of attribute global.


56
57
58
# File 'lib/ruby_event_store/subscriptions.rb', line 56

def global
  @global
end

#localObject (readonly)

Returns the value of attribute local.


56
57
58
# File 'lib/ruby_event_store/subscriptions.rb', line 56

def local
  @local
end

Instance Method Details

#all_for(event_type) ⇒ Object


58
59
60
# File 'lib/ruby_event_store/subscriptions.rb', line 58

def all_for(event_type)
  [global, local].map{|r| r.all_for(event_type)}.reduce(&:+)
end