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

Remove onLock clauses from ExchangeScope #169

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

alexandrepiveteau
Copy link
Member

@alexandrepiveteau alexandrepiveteau self-assigned this Sep 12, 2021
@alexandrepiveteau alexandrepiveteau merged commit 0033f8d into markdown-party:main Sep 13, 2021
@alexandrepiveteau alexandrepiveteau deleted the no-onlock branch September 13, 2021 17:20
@qwwdfsad
Copy link

Hi!

It seems like you are one of the users of onLock, could you please elaborate on whether onLock removal significantly affects you? E.g. was your onLock usage important for API design or it was just made similar to Mutex?

@alexandrepiveteau
Copy link
Member Author

Hi, I was using onLock very similarly to a standard Mutex, and its deprecation won’t affect the API much.

In this project, a bunch of coroutines are receiving events to be added to a mutable event log. Access to the event log requires mutual exclusion, and selection using onLock simply let each coroutine select on either adding events to the log, or receiving some more events (which would be added to the event lock when it becomes available). Naively using Mutex.withLock after each event reception is the alternative I’ve implemented (even if it means events won’t be batch-inserted anymore).

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

Successfully merging this pull request may close these issues.

2 participants