| Methods |
public
|
__construct()
|
#
|
public
|
setClientInfo(
string $name,
string $version,
?string $title = null,
?string $description = null,
?string $websiteUrl = null,
null|list<Icon> $icons = null,
): self
|
#
|
public
|
setClientCapabilities(ClientCapabilities $capabilities): self
Declares the capabilities advertised in every request's _meta envelope.
Declares the capabilities advertised in every request's _meta envelope.
|
#
|
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. Each
progress notification for the request restarts it.
Seconds a request may go unanswered before it is abandoned, or null to wait indefinitely. Each
progress notification for the request restarts it.
|
#
|
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, instead of failing it.
Off by default: a retry is at-least-once, so the peer may have served the request before it died.
Sends a state-reading request again when the peer carrying it is replaced, instead of failing it.
Off by default: a retry is at-least-once, so the peer may have served the request before it died.
|
#
|
public
|
setRequestIdFactory(Closure(): (int|non-empty-string) $factory): self
Overrides the default monotonically-incrementing integer factory.
Overrides the default monotonically-incrementing integer factory.
|
#
|
public
|
setProgressTokenFactory(Closure(): (int|non-empty-string) $factory): self
Overrides the default progress-token factory used by Client::callTool()
when an onProgress callback is supplied.
Overrides the default progress-token factory used by Client::callTool()
when an onProgress callback is supplied.
|
#
|
public
|
addRequestHandler(
non-empty-string $method,
RequestHandlerInterface<non-empty-string, Result, ClientContext> $handler,
): self
Registers a handler for an inbound request method the peer may send to the client.
Registers a handler for an inbound request method the peer may send to the client.
|
#
|
public
|
addNotificationHandler(non-empty-string $method, NotificationHandlerInterface<non-empty-string> $handler): self
Registers a handler for an inbound notification method.
Registers a handler for an inbound notification method.
|
#
|
public
|
build(): Client
|
#
|