Class: RServiceBus::SagaStorage_InMemory
- Inherits:
-
Object
- Object
- RServiceBus::SagaStorage_InMemory
- Defined in:
- lib/rservicebus/SagaStorage/InMemory.rb
Instance Method Summary collapse
-
#Begin ⇒ Object
Start.
-
#Commit ⇒ Object
Finish.
- #Delete(correlationId) ⇒ Object
-
#Get(correlationId) ⇒ Object
Get.
-
#initialize(uri) ⇒ SagaStorage_InMemory
constructor
A new instance of SagaStorage_InMemory.
- #Rollback ⇒ Object
-
#Set(data) ⇒ Object
Set.
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
#Begin ⇒ Object
Start
10 11 12 13 |
# File 'lib/rservicebus/SagaStorage/InMemory.rb', line 10 def Begin @hash = Hash.new @deleted = Array.new end |
#Commit ⇒ Object
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 |
#Rollback ⇒ Object
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 |