Class: Legate::SessionService::Base
- Inherits:
-
Object
- Object
- Legate::SessionService::Base
- Defined in:
- lib/legate/session_service/base.rb
Overview
Base class for session services
Direct Known Subclasses
Instance Method Summary collapse
- #append_event(session_id:, event:) ⇒ Object
-
#clear_scoped_state(scope, key) ⇒ Object
Clears scoped state.
-
#get_state(session_id:, key:) ⇒ Object?
Retrieves a value from the state associated with the session.
-
#load_scoped_state(scope, key) ⇒ Object?
Loads scoped state.
-
#persistent? ⇒ Boolean
Returns whether this service persists state.
-
#save_scoped_state(scope, key, value) ⇒ Object
Saves scoped state.
-
#set_state(session_id:, key:, value:) ⇒ void
Sets a key-value pair in the state associated with the session.
Instance Method Details
#append_event(session_id:, event:) ⇒ Object
40 41 42 |
# File 'lib/legate/session_service/base.rb', line 40 def append_event(session_id:, event:) raise NotImplementedError, "#{self.class.name} must implement #append_event." end |
#clear_scoped_state(scope, key) ⇒ Object
Clears scoped state
36 37 38 |
# File 'lib/legate/session_service/base.rb', line 36 def clear_scoped_state(scope, key) raise NotImplementedError, "#{self.class} must implement #clear_scoped_state" end |
#get_state(session_id:, key:) ⇒ Object?
Retrieves a value from the state associated with the session. This typically involves finding the session and then calling the session object’s own state management methods (e.g., session.get_state(key)).
63 64 65 |
# File 'lib/legate/session_service/base.rb', line 63 def get_state(session_id:, key:) raise NotImplementedError, "#{self.class.name} must implement #get_state." end |
#load_scoped_state(scope, key) ⇒ Object?
Loads scoped state
28 29 30 |
# File 'lib/legate/session_service/base.rb', line 28 def load_scoped_state(scope, key) raise NotImplementedError, "#{self.class} must implement #load_scoped_state" end |
#persistent? ⇒ Boolean
Returns whether this service persists state
10 11 12 |
# File 'lib/legate/session_service/base.rb', line 10 def persistent? false end |
#save_scoped_state(scope, key, value) ⇒ Object
Saves scoped state
19 20 21 |
# File 'lib/legate/session_service/base.rb', line 19 def save_scoped_state(scope, key, value) raise NotImplementedError, "#{self.class} must implement #save_scoped_state" end |
#set_state(session_id:, key:, value:) ⇒ void
This method returns an undefined value.
Sets a key-value pair in the state associated with the session. This typically involves finding the session and then calling the session object’s own state management methods (e.g., session.set_state(key, value)).
52 53 54 |
# File 'lib/legate/session_service/base.rb', line 52 def set_state(session_id:, key:, value:) raise NotImplementedError, "#{self.class.name} must implement #set_state." end |