Class: RubyEventStore::PubSub::Subscriptions::ThreadSubscriptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeThreadSubscriptions

Returns a new instance of ThreadSubscriptions.



36
37
38
39
# File 'lib/ruby_event_store/pub_sub/subscriptions.rb', line 36

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

Instance Attribute Details

#globalObject (readonly)

Returns the value of attribute global.



40
41
42
# File 'lib/ruby_event_store/pub_sub/subscriptions.rb', line 40

def global
  @global
end

#localObject (readonly)

Returns the value of attribute local.



40
41
42
# File 'lib/ruby_event_store/pub_sub/subscriptions.rb', line 40

def local
  @local
end

Instance Method Details

#all_for(event_type) ⇒ Object



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

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