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 |
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 |