Class: Aws::SessionStore::DynamoDB::Locking::Pessimistic Private

Inherits:
Base
  • Object
show all
Defined in:
lib/aws/session_store/dynamo_db/locking/pessimistic.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

Methods inherited from Base

#delete_session, #initialize

Constructor Details

This class inherits a constructor from Aws::SessionStore::DynamoDB::Locking::Base

Instance Method Details

#get_session_data(env, sid) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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, options = {})
  super(env, sid, session, set_lock_options(env, options))
end