Class: EventStoreClient::Broker

Inherits:
Object
  • Object
show all
Defined in:
lib/event_store_client/broker.rb

Instance Method Summary collapse

Instance Method Details

#call(subscriptions) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/event_store_client/broker.rb', line 5

def call(subscriptions)
  subscriptions.each do |subscription|
    new_events = connection.consume_feed(subscription.stream, subscription.name) || []
    next if new_events.none?
    new_events.each { |event| subscription.subscriber.call(event) }
  end
end