PredisCorpusClient
Rasuvaeff\PropertyTesting\Runner\Redis\PredisCorpusClient
Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2
Implements: Runner\Redis\CorpusClient
CorpusClient over predis.
Constructor
php
__construct(
\Predis\ClientInterface $client,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$client | Predis\ClientInterface | required | A connected client. |
Methods
get()
php
get(string $key): ?stringThe stored document for $key, or null when the key does not exist.
Documentation inherited from Runner\Redis\CorpusClient.
$key— The corpus key, already namespaced by the caller.
compareAndSet()
php
compareAndSet(
string $key,
?string $expected,
?string $document,
): boolStores $document for $key only if the stored value is still $expected — the whole read-modify-write of a corpus write, made safe without holding a lock across a round trip.
Documentation inherited from Runner\Redis\CorpusClient.
$key— The corpus key, already namespaced by the caller.$expected— The document the caller read, or null when the key was absent.$document— The document to store, or null to delete the key (an empty corpus is an absent key, exactly as an empty corpus is an absent file on disk).
Throws:
Predis\Response\ServerException— When the server refuses the script for a reason other than not knowing it yet (NOSCRIPTis answered with a plainEVAL).