Class: RServiceBus::SagaStorage_InMemory

Inherits:
Object
  • Object
show all
Defined in:
lib/rservicebus/SagaStorage/InMemory.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ SagaStorage_InMemory

Returns a new instance of SagaStorage_InMemory.



6
7
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 6

def initialize( uri )
end

Instance Method Details

#BeginObject

Start



10
11
12
13
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 10

def Begin
    @hash = Hash.new
    @deleted = Array.new
end

#CommitObject

Finish



26
27
28
29
30
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 26

def Commit
    @deleted.each do |correlationId|
        @hash.delete( correlationId )
    end
end

#Delete(correlationId) ⇒ Object



32
33
34
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 32

def Delete( correlationId )
    @deleted << correlationId
end

#Get(correlationId) ⇒ Object

Get



21
22
23
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 21

def Get( correlationId )
    return @hash[correlationId]
end

#RollbackObject



36
37
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 36

def Rollback
end

#Set(data) ⇒ Object

Set



16
17
18
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 16

def Set( data )
    @hash[data.correlationId] = data
end