class SemaphoreStore implementsBlockingStoreInterface

SemaphoreStore is a PersistingStoreInterface implementation using Semaphore as store engine.

Methods

static bool
isSupported()

Returns whether or not the store is supported.

__construct()

No description

void
save(Key$key)

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

void
waitAndSave(Key$key)

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

void
delete(Key$key)

Removes a resource from the storage.

void
putOffExpiration(Key$key,float$ttl)

Extends the TTL of a resource.

bool
exists(Key$key)

Returns whether or not the resource exists in the storage.

Details

staticbool isSupported()

Returns whether or not the store is supported.

Return Value

bool

__construct()

void save(Key$key)

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

Parameters

Key $key

Return Value

void

Exceptions

LockAcquiringException
LockConflictedException

void waitAndSave(Key$key)

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

Parameters

Key $key

Return Value

void

Exceptions

LockConflictedException

void delete(Key$key)

Removes a resource from the storage.

Parameters

Key $key

Return Value

void

Exceptions

LockReleasingException

void putOffExpiration(Key$key,float$ttl)

Extends the TTL of a resource.

Parameters

Key $key
float $ttl

Return Value

void

Exceptions

LockConflictedException

bool exists(Key$key)

Returns whether or not the resource exists in the storage.

Parameters

Key $key

Return Value

bool