lib/real_world/ports/event_broker/in_memory.rb
# Publishes a series of events under a certain stream and returns
# the published events. If the stream did not exist beforehand,
# it creates it
#
# @param stream [Symbol] The name of the stream
# @param events [Array<Event>] An array of events to publish
# @return [Array<EventInStream>] An array containing the
#   published events in the same order as received
Publishes a series of events under a certain stream and returns
the published events. If the stream did not exist beforehand,
it creates it
Publishes a series of events under a certain stream and returns the published events . If the stream did not exist beforehand it creates it
def publish(stream, events)
          if @within_transaction
            @buffer << [stream, events]
            events
          else
            publish!(stream, events)
          end
        end
def publish ( stream , events ) if @within_transaction @buffer << [ stream , events ] events else publish! ( stream , events ) end end
Publishes a series of events under a certain stream and returns
the published events.
Publishes a series of events under a certain stream and returns the published events .
An array containing the published events in the same order as received
An array containing the published events in the same order as received
Array<EventInStream>
stream
The name of the stream
The name of the stream
events
An array of events to publish
An array of events to publish