lib/real_world/ports/event_broker/in_memory.rb
# Creates a new in-memory event broker with a clean state
Creates a new in-memory event broker with a clean state
Creates a new in - memory event broker with a clean state
def publish!(stream, events)
          @streams[stream.to_sym] = true 
          events.each do |event|
            subscribers(stream).each do |callback|
              callback.call(event)
            end
          end
        end
def publish! ( stream , events ) @streams [ stream . to_sym ] = true events . each do | event | subscribers ( stream ) . each do | callback | callback . call ( event ) end end end
Creates a new in-memory event broker with a clean state
Creates a new in - memory event broker with a clean state
# Create stream
stream
<not_specific>
events
<not_specific>