pb_client.autostart.open_connection
async
¶
open_connection(endpoint, *, autostart=True)
Connect to the service, starting one if necessary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
Endpoint
|
Where the service is, or should be. |
required |
autostart
|
bool
|
Whether to start a service when none is running. |
True
|
Yields:
| Type | Description |
|---|---|
AsyncGenerator[ByteStream, None]
|
The connected stream. |
Raises:
| Type | Description |
|---|---|
ServiceUnavailable
|
If no service is running and |
ServiceStartError
|
If a service was started but never became reachable. |