grpc-swift
grpc-swift copied to clipboard
Checking connection state on async calls
How can I check the connection status for asynchronous calls?
I tried use ConnectivityStateMonitor but caught error 'ConnectivityStateMonitor' initializer is inaccessible due to 'internal' protection level, although ConnectivityStateMonitor is public
public class ConnectivityStateMonitor: @unchecked Sendable {
Calls don't have a connectivity state as calls are multiplexed on connections. A connection has a connectivity state. The connectivity state monitor is only available via the connectivity property on ClientConnection. It isn't available on the connection pool.
Generally speaking it isn't that useful to check the connectivity state: if you start a call and no connection is available then one will be established and the call will be queued.