lib/real_world/ports/event_broker/in_memory.rb
# Executes the given block within a transaction
Executes the given block within a transaction
Executes the given block within a transaction
def transaction
          @within_transaction = true
          @buffer = []
          yield
        rescue ::Object
          @buffer.clear
          raise
        ensure
          @buffer.each { |params| publish!(*params) }
          @buffer.clear
          @within_transaction = false
        end
def transaction @within_transaction = true @buffer = [ ] yield rescue :: Object @buffer . clear raise ensure @buffer . each { | params | publish! ( * params ) } @buffer . clear @within_transaction = false end
Executes the given block within a transaction
Executes the given block within a transaction