Subscriber
class Subscriber
Properties
| bool | $closed | ||
| protected CommandInvoker | $commandInvoker | ||
| protected array<string, true> | $channels | Active prefixed channel subscriptions. |
|
| protected array<string, true> | $patterns | Active prefixed pattern subscriptions. |
Methods
__construct(string $host, int $port = 6379, string|array|null $password = null, float $timeout = 5.0, string $prefix = '', string|null $username = null, string|null $scheme = null, array $context = [], StdoutLoggerInterface|null $logger = null)
Create a new Redis subscriber.
void
subscribe(string ...$channels)
Subscribe to Redis channels.
void
unsubscribe(string ...$channels)
Unsubscribe from Redis channels.
void
psubscribe(string ...$channels)
Subscribe to Redis channel patterns.
void
punsubscribe(string ...$channels)
Unsubscribe from Redis channel patterns.
void
close()
Close the Redis subscriber.
string|bool
ping(float $timeout = 1)
Ping the Redis subscriber connection.
void
connect()
Connect the Redis subscriber.
Details
at line 39
__construct(string $host, int $port = 6379, string|array|null $password = null, float $timeout = 5.0, string $prefix = '', string|null $username = null, string|null $scheme = null, array $context = [], StdoutLoggerInterface|null $logger = null)
Create a new Redis subscriber.
at line 60
void
subscribe(string ...$channels)
Subscribe to Redis channels.
at line 80
void
unsubscribe(string ...$channels)
Unsubscribe from Redis channels.
at line 102
void
psubscribe(string ...$channels)
Subscribe to Redis channel patterns.
at line 122
void
punsubscribe(string ...$channels)
Unsubscribe from Redis channel patterns.
at line 140
Channel
channel()
Get the subscriber message channel.
at line 150
void
close()
Close the Redis subscriber.
at line 162
string|bool
ping(float $timeout = 1)
Ping the Redis subscriber connection.
at line 173
protected void
connect()
Connect the Redis subscriber.