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

Provide Peripheral CoroutineScope via scope property #846

Merged
merged 2 commits into from
Jan 30, 2025
Merged

Conversation

twyatt
Copy link
Member

@twyatt twyatt commented Jan 28, 2025

Peripheral no longer implements CoroutineScope, instead: it is now a scope property.

Per CoroutineScope documentation:

Manual implementation of this interface is not recommended, implementation by delegation should be preferred instead.

CoroutineScope should be declared as a property on entities with a well-defined lifecycle that are responsible for launching child coroutines.

To make the Peripheral API more explicit, it now implements AutoCloseable with close cancelling the Peripheral's coroutine scope (scope property).

@twyatt twyatt added the major Changes that should bump the MAJOR version number label Jan 28, 2025
@twyatt twyatt added this to the 0.36.0 milestone Jan 28, 2025
@twyatt twyatt marked this pull request as ready for review January 28, 2025 22:54
@twyatt twyatt requested a review from a team as a code owner January 28, 2025 22:54
@twyatt twyatt merged commit bafead5 into main Jan 30, 2025
2 checks passed
@twyatt twyatt deleted the twyatt/scope branch January 30, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Changes that should bump the MAJOR version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants