SessionLockInterface
Serializes the requests of one session across the workers that serve it.
A request loads its session, changes it and writes it back whole, so two requests of one session running at the same time can overwrite each other's changes. The Protocol holds the lock from before it reads the session until it saved it, and releases it while a handler waits for the client. A stream polling for the client's answer only takes the lock when it is free.
Tags
Table of Contents
Methods
- acquire() : void
- Blocks until the lock of the session is held, or gives up after the implementation's timeout.
- release() : void
- tryAcquire() : bool
- Takes the lock of the session only if no other request holds it right now, without waiting.
Methods
acquire()
Blocks until the lock of the session is held, or gives up after the implementation's timeout.
public
acquire(Uuid $sessionId) : void
Parameters
- $sessionId : Uuid
Tags
release()
public
release(Uuid $sessionId) : void
Parameters
- $sessionId : Uuid
Tags
tryAcquire()
Takes the lock of the session only if no other request holds it right now, without waiting.
public
tryAcquire(Uuid $sessionId) : bool
Parameters
- $sessionId : Uuid
Tags
Return values
bool —false when another request holds the lock