Class: Aws::SessionStore::DynamoDB::Locking::Pessimistic
- Defined in:
- lib/aws/session_store/dynamo_db/locking/pessimistic.rb
Overview
This class implements a pessimistic locking strategy for the DynamoDB session handler. Sessions obtain an exclusive lock for reads that is only released when the session is saved.
Instance Method Summary collapse
-
#get_session_data(env, sid) ⇒ Object
Gets session from database and places a lock on the session while you are reading from the database.
-
#set_session_data(env, sid, session, options = {}) ⇒ Object
Saves the session.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Aws::SessionStore::DynamoDB::Locking::Base
Instance Method Details
#get_session_data(env, sid) ⇒ Object
Gets session from database and places a lock on the session while you are reading from the database.
15 16 17 18 19 |
# File 'lib/aws/session_store/dynamo_db/locking/pessimistic.rb', line 15 def get_session_data(env, sid) handle_error(env) do get_session_with_lock(env, sid) end end |
#set_session_data(env, sid, session, options = {}) ⇒ Object
Saves the session.
9 10 11 |
# File 'lib/aws/session_store/dynamo_db/locking/pessimistic.rb', line 9 def set_session_data(env, sid, session, = {}) super(env, sid, session, (env, )) end |