class RubyEventStore::Subscriptions::ThreadGlobalSubscriptions
Public Class Methods
new()
click to toggle source
# File lib/ruby_event_store/subscriptions.rb, line 95 def initialize @subscriptions = Concurrent::ThreadLocalVar.new([]) end
Public Instance Methods
add(subscription)
click to toggle source
# File lib/ruby_event_store/subscriptions.rb, line 99 def add(subscription) @subscriptions.value += [subscription] -> { @subscriptions.value -= [subscription] } end
all_for(_event_type)
click to toggle source
# File lib/ruby_event_store/subscriptions.rb, line 104 def all_for(_event_type) @subscriptions.value end