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

Use flowOn to make multiplexing actually parallel. #496

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

restingbull
Copy link
Collaborator

Added simple multiplex example from @jdai8.

Issue: 494

@@ -83,6 +84,7 @@ class PersistentWorker(
blockable {
generateSequence { WorkRequest.parseDelimitedFrom(io.input) }
}.asFlow()
.flowOn(coroutineContext)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work if we're not actually launching any new coroutines?

@@ -83,6 +84,7 @@ class PersistentWorker(
blockable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unblockedContext on line 60 is unused, is that intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, yeah.

@restingbull restingbull merged commit 6e9fc29 into master Mar 2, 2021
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.

3 participants