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

Decide how DefaultAbly methods should respond to cancellation #908

Open
lawrence-forooghian opened this issue Jan 14, 2023 · 1 comment
Open
Labels
code-quality Affects the developer experience when working in our codebase.

Comments

@lawrence-forooghian
Copy link
Collaborator

The methods in DefaultAbly do not all cooperate with cancellation. For example, due to its use of suspendCoroutine (as opposed to suspendCancellableCoroutine), the suspending version of connect is not cancellable.

The implication of this is that if, for example, connect is called from within a withTimeout block, the withTimeout call will not return even if the timeout elapses before connect returns.

This has implications on our unit tests, which need to work around this lack of cancellability. I do not know if it has any implications for the public API of the library – for example, whether it impacts users’ ability to wrap Publisher methods in a withTimeout block.

We should understand the implications and decide if/how to address them.

@lawrence-forooghian lawrence-forooghian added the code-quality Affects the developer experience when working in our codebase. label Jan 14, 2023
@sync-by-unito
Copy link

sync-by-unito bot commented Jan 14, 2023

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Affects the developer experience when working in our codebase.
Development

No branches or pull requests

1 participant