Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
whoamicapabilitiesping
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKIntrospectionping

ping

A connection-level liveness check that works while streams are in flight.

PURPOSE

A connection-level liveness check. It travels on the connection itself rather than as a request stream, so it works while streams are in flight — which is what makes it the right way to keep an idle pooled connection honest.

Handshake credentialstable
ping(request?: Partial<PingRequest>): Promise<PongResponse>

Parameters

ParameterTypeRequired
clientTimestampUnixNanos64-bit integeroptional

Defaults to now, so a call with no argument is the normal one. Compare it against the pong's timestamps to measure round-trip time.

Returns

FieldTypePresence
—PongResponsealways

The server's reply, carrying its own timestamps.

Wire tier only

There is no HTTP ping. The HTTP client holds no connection, so there is nothing to keep alive — use whoami if you want a cheap reachability check over HTTP.

A pooled connection outlives any single request, so a server restart leaves every borrower holding the same dead socket. ping detects that; the pool's health-checking accessor fixes it. See Wire client.

See also
Wire clientwhoami

Was this page helpful?

capabilities

Which optional capabilities are enabled on this shard, and the vector dimension you must match.

Errors

Both error taxonomies — the wire BrainError hierarchy with its nine categories and the eighty-odd codes, and the HTTP tier's BrainHttpError.

On this page

ParametersReturns
Suggest an editOpen in Playground