| Methods |
public
static
|
createPair(): array{self, self}
Returns two linked transports. Each side's send() delivers to the
other side's onMessage listeners. Use one for the server, the other
for the client.
Returns two linked transports. Each side's send() delivers to the
other side's onMessage listeners. Use one for the server, the other
for the client.
|
#
|
public
|
start(): void
Begins consuming inbound envelopes from the peer. Returns immediately.
Begins consuming inbound envelopes from the peer. Returns immediately.
Implements
|
#
|
public
|
send(JsonRpcMessage $message, ?SendContext $context = null): void
$context's relatedRequestId is a streamable-HTTP concern with no in-process
equivalent. The parameter is accepted for TransportInterface conformance and
intentionally dropped.
$context's relatedRequestId is a streamable-HTTP concern with no in-process
equivalent. The parameter is accepted for TransportInterface conformance and
intentionally dropped.
Throws
Implements
|
#
|
public
|
close(): void
Closes the connection. The onClose() listener fires once after the
underlying streams are closed. Subsequent calls are no-ops. Implementations MUST guarantee that onClose() listeners fire after a
fatal error too, not only after explicit close(). Server::run()
blocks on the close signal, so a transport that raises errors without
eventually closing would hang the server loop.
Closes the connection. The onClose() listener fires once after the
underlying streams are closed. Subsequent calls are no-ops. Implementations MUST guarantee that onClose() listeners fire after a
fatal error too, not only after explicit close(). Server::run()
blocks on the close signal, so a transport that raises errors without
eventually closing would hang the server loop.
Implements
|
#
|
public
|
onMessage(Closure $listener): SubscriptionInterface
Register an inbound-envelope listener.
Register an inbound-envelope listener.
Implements
|
#
|
public
|
onError(Closure $listener): SubscriptionInterface
In-memory transport has no I/O failure surface, so registered error
listeners are accepted for contract conformance but never invoked.
In-memory transport has no I/O failure surface, so registered error
listeners are accepted for contract conformance but never invoked.
Implements
|
#
|
public
|
onDrain(Closure $listener): SubscriptionInterface
Register a drain listener that fires before close().
Register a drain listener that fires before close().
Implements
|
#
|
public
|
onClose(Closure $listener): SubscriptionInterface
Register a close listener.
Register a close listener.
Implements
|
#
|