Skip to content

pb_client.service.connect async

connect(endpoint=None, *, autostart=True)

Connect to the service for the duration of the block.

Parameters:

Name Type Description Default
endpoint Endpoint | str | None

Where the service is. Defaults to the platform's own address, or PB_ENDPOINT. Users are not expected to supply this.

None
autostart bool

Whether to start a service if none is running.

True

Yields:

Type Description
AsyncGenerator[Service, None]

The connected service.

Raises:

Type Description
ServiceUnavailable

If no service is running and autostart is false, or if no authentication token exists to present.