| Methods |
public
|
__construct()
|
#
|
public
|
enableExtension(ClientExtensionInterface $extension): self
|
#
|
public
|
setClientInfo(
non-empty-string $name,
non-empty-string $version,
null|non-empty-string $title = null,
null|non-empty-string $description = null,
null|non-empty-string $websiteUrl = null,
null|list<Icon> $icons = null,
): self
|
#
|
public
|
setClientCapabilities(ClientCapabilities $capabilities): self
|
#
|
public
|
setLogger(LoggerInterface $logger): self
|
#
|
public
|
setRequestTimeout(?float $seconds): self
Seconds a request may go unanswered before it is abandoned, or null to wait indefinitely.
Seconds a request may go unanswered before it is abandoned, or null to wait indefinitely.
|
#
|
public
|
setMaxRequestTimeout(?float $seconds): self
Seconds a request may run in total however much progress arrives, or null to leave it unbounded.
Seconds a request may run in total however much progress arrives, or null to leave it unbounded.
|
#
|
public
|
setRetryLostRequests(bool $retry): self
Sends a state-reading request again when the peer carrying it is replaced, which is an at-least-once
retry.
Sends a state-reading request again when the peer carrying it is replaced, which is an at-least-once
retry.
|
#
|
public
|
setMaxInFlightDispatches(?int $max): self
Caps how many inbound messages the client processes at once, defaulting to DEFAULT_MAX_IN_FLIGHT, with
null lifting the cap.
Caps how many inbound messages the client processes at once, defaulting to DEFAULT_MAX_IN_FLIGHT, with
null lifting the cap.
|
#
|
public
|
setRequestIdFactory(Closure(): (int|non-empty-string) $factory): self
|
#
|
public
|
setProgressTokenFactory(Closure(): (int|non-empty-string) $factory): self
|
#
|
public
|
setMetaExtrasFactory(Closure(): array<non-empty-string, mixed> $factory): self
Sets the factory called once per outbound request for the extra _meta keys it carries, such as the W3C
traceparent. A lifecycle key it returns is ignored.
Sets the factory called once per outbound request for the extra _meta keys it carries, such as the W3C
traceparent. A lifecycle key it returns is ignored.
|
#
|
public
|
addRequestHandler(
class-string<JsonRpcRequest<non-empty-string>> $request,
RequestHandlerInterface<non-empty-string, Result, ClientContext> $handler,
): self
|
#
|
public
|
addNotificationHandler(
class-string<JsonRpcNotification<non-empty-string>> $notification,
NotificationHandlerInterface<non-empty-string> $handler,
): self
|
#
|
public
|
build(): Client
|
#
|