Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking connection state on async calls #1811

Open
ismail9001 opened this issue Feb 16, 2024 · 1 comment
Open

Checking connection state on async calls #1811

ismail9001 opened this issue Feb 16, 2024 · 1 comment
Labels

Comments

@ismail9001
Copy link

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 {

@glbrntt
Copy link
Collaborator

glbrntt commented Feb 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants