class SemaphoreStore implements StoreInterface

SemaphoreStore is a StoreInterface implementation using Semaphore as store engine.

Methods

static bool
isSupported()

Returns whether or not the store is supported.

__construct()

No description

save(Key $key)

Stores the resource if it's not locked by someone else.

waitAndSave(Key $key)

Waits until a key becomes free, then stores the resource.

delete(Key $key)

Removes a resource from the storage.

putOffExpiration(Key $key, $ttl)

Extends the ttl of a resource.

bool
exists(Key $key)

Returns whether or not the resource exists in the storage.

Details

at line 33
static bool isSupported()

Returns whether or not the store is supported.

Return Value

bool

at line 38
__construct()

at line 48
save(Key $key)

Stores the resource if it's not locked by someone else.

at line 56
waitAndSave(Key $key)

Waits until a key becomes free, then stores the resource.

If the store does not support this feature it should throw a NotSupportedException.

at line 86
delete(Key $key)

Removes a resource from the storage.

Parameters

Key $key

Exceptions

LockReleasingException

at line 103
putOffExpiration(Key $key, $ttl)

Extends the ttl of a resource.

If the store does not support this feature it should throw a NotSupportedException.

Parameters

Key $key
$ttl

Exceptions

LockConflictedException
NotSupportedException

at line 111
bool exists(Key $key)

Returns whether or not the resource exists in the storage.

Parameters

Key $key

Return Value

bool