Class: Phronomy::StateStore::Base
- Inherits:
-
Object
- Object
- Phronomy::StateStore::Base
- Defined in:
- lib/phronomy/state_store/base.rb
Overview
Abstract base class for state persistence backends. Subclasses must implement save, load, and clear.
The state object passed to save must include Phronomy::Graph::State and have a non-nil thread_id (set automatically by CompiledGraph#invoke).
Direct Known Subclasses
Instance Method Summary collapse
-
#clear(thread_id) ⇒ self
Removes the saved state for the given thread_id.
-
#load(thread_id) ⇒ Object?
Loads the state for the given thread_id.
-
#save(state) ⇒ self
Persists the state.
Instance Method Details
#clear(thread_id) ⇒ self
Removes the saved state for the given thread_id.
30 31 32 |
# File 'lib/phronomy/state_store/base.rb', line 30 def clear(thread_id) raise NotImplementedError, "#{self.class}#clear is not implemented" end |
#load(thread_id) ⇒ Object?
Loads the state for the given thread_id.
23 24 25 |
# File 'lib/phronomy/state_store/base.rb', line 23 def load(thread_id) raise NotImplementedError, "#{self.class}#load is not implemented" end |
#save(state) ⇒ self
Persists the state. The thread_id is read from state.thread_id.
16 17 18 |
# File 'lib/phronomy/state_store/base.rb', line 16 def save(state) raise NotImplementedError, "#{self.class}#save is not implemented" end |