| Methods |
public
|
__construct(
Closure(): SupervisableTransportInterface $factory,
int $maxRestarts = 3,
float $restartDelay = 0.1,
LoggerInterface $logger = new NullLogger(),
float $restartWindow = self::DEFAULT_RESTART_WINDOW,
Stopwatch $stopwatch = new HighResolutionStopwatch(),
)
Parameters
| $factory |
Mints one connection, called once per spawn.
|
| $maxRestarts |
Respawns allowed within one window before giving up.
|
| $restartDelay |
Seconds to wait before each respawn.
|
| $restartWindow |
Seconds the restart count is measured over.
|
|
#
|
public
|
start(): void
Begins consuming inbound envelopes from the peer, returning immediately.
Begins consuming inbound envelopes from the peer, returning immediately.
Implements
|
#
|
public
|
send(JsonRpcMessage $message, ?SendContext $context = null): void
Enqueues an outbound JSON-RPC message to the peer, close listeners firing before a write failure is rethrown.
Enqueues an outbound JSON-RPC message to the peer, close listeners firing before a write failure is rethrown.
Implements
|
#
|
public
|
close(): void
Closes the connection once, firing onClose() after the underlying streams close, which an
implementation MUST also do after a fatal error since Server::run() blocks on that signal.
A call from another fiber while a close is in progress MUST block until that close settles,
while one re-entering from the closing fiber returns immediately.
Closes the connection once, firing onClose() after the underlying streams close, which an
implementation MUST also do after a fatal error since Server::run() blocks on that signal.
A call from another fiber while a close is in progress MUST block until that close settles,
while one re-entering from the closing fiber returns immediately.
Implements
|
#
|
public
|
onMessage(Closure $listener): ListenerHandleInterface
A transport multiplexing several peers MUST namespace or rewrite inbound request ids before
emitting them, since the protocol layer correlates and cancels by id alone.
A transport multiplexing several peers MUST namespace or rewrite inbound request ids before
emitting them, since the protocol layer correlates and cancels by id alone.
Implements
|
#
|
public
|
onError(Closure $listener): ListenerHandleInterface
|
#
|
public
|
onDrain(Closure $listener): ListenerHandleInterface
Register a drain listener that fires before close().
Register a drain listener that fires before close().
Implements
|
#
|
public
|
onClose(Closure $listener): ListenerHandleInterface
|
#
|
public
|
isReconnecting(): bool
Whether a replacement connection is still on its way, read when a per-connection operation fails
rather than before one is issued.
Whether a replacement connection is still on its way, read when a per-connection operation fails
rather than before one is issued.
Implements
|
#
|
public
|
onReconnect(Closure $listener): ListenerHandleInterface
Registers a listener invoked once for every replacement connection that has started serving, after the
close for the one it replaces and never for the first.
Registers a listener invoked once for every replacement connection that has started serving, after the
close for the one it replaces and never for the first.
Implements
|
#
|