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.



38
39
40
41
# File 'lib/ruby_event_store/subscriptions.rb', line 38

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

Instance Attribute Details

#globalObject (readonly)

Returns the value of attribute global.



42
43
44
# File 'lib/ruby_event_store/subscriptions.rb', line 42

def global
  @global
end

#localObject (readonly)

Returns the value of attribute local.



42
43
44
# File 'lib/ruby_event_store/subscriptions.rb', line 42

def local
  @local
end

Instance Method Details

#all_for(event_type) ⇒ Object



44
45
46
# File 'lib/ruby_event_store/subscriptions.rb', line 44

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