CommandInvoker
class CommandInvoker
Constants
| private MESSAGE_PUSH_TIMEOUT |
|
Properties
| protected Channel | $resultChannel | ||
| protected Channel | $messageChannel |
Methods
Create a new Redis subscriber command invoker.
Invoke a Redis subscriber command.
Interrupt the subscriber connection.
Ping the Redis subscriber connection.
Watch for worker shutdown and interrupt the connection.
Start the Redis subscriber receive loop.
Details
at line 35
__construct(Connection $connection, StdoutLoggerInterface|null $logger = null, float $timeout = 5.0)
Create a new Redis subscriber command invoker.
at line 62
array
invoke(int|string|array|null $command, int $number)
Invoke a Redis subscriber command.
at line 118
Channel
channel()
Get the subscriber message channel.
at line 126
bool
interrupt()
Interrupt the subscriber connection.
at line 153
string|bool
ping(float $timeout = 1)
Ping the Redis subscriber connection.
at line 198
protected void
receive(Connection $connection)
Receive Redis subscriber responses.
at line 358
protected void
watchForShutdown()
Watch for worker shutdown and interrupt the connection.
Without this, the receive loop's socket recv blocks indefinitely and Swoole's coroutine scheduler cannot detect the deadlock (active I/O keeps the event loop alive). This provides a deterministic shutdown path that doesn't depend on coroutine scheduling order.
at line 368
protected void
loop()
Start the Redis subscriber receive loop.