Class: RCrewAI::Flow::MemoryStateStore

Inherits:
Object
  • Object
show all
Defined in:
lib/rcrewai/flow/state_store.rb

Overview

Persists flow state keyed by state id, so a flow can be resumed across restarts. Two built-ins: in-memory (tests / single process) and file-based (JSON on disk). Any object with #save(id, hash) and #load(id) works.

Instance Method Summary collapse

Constructor Details

#initializeMemoryStateStore

Returns a new instance of MemoryStateStore.



12
13
14
# File 'lib/rcrewai/flow/state_store.rb', line 12

def initialize
  @data = {}
end

Instance Method Details

#load(id) ⇒ Object



20
21
22
# File 'lib/rcrewai/flow/state_store.rb', line 20

def load(id)
  @data[id]
end

#save(id, hash) ⇒ Object



16
17
18
# File 'lib/rcrewai/flow/state_store.rb', line 16

def save(id, hash)
  @data[id] = hash.dup
end