-
Notifications
You must be signed in to change notification settings - Fork 257
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
Async Eventloop #1474
Merged
Merged
Async Eventloop #1474
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… so that it will break rather than crash
So I think this may get async pipelines working, running continuations on the same thread, but there is a fair amount of testing to do still. However, @preardon if you wanted to play by flipping the runAsync flag on your subscription to true and see if it explodes, its a starting point. |
…ext to manage callbacks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is intended to support us having async dispatcher pipelines again. Obviously, these need documentation because they have side efffects developers may not understand such as Requests lose guarantee of processing "in order"
There is a lot to consider here:
Do we want threadpool based callbacks?
-- This may be the easiest to get 'working'
-- We now have an issue with backpressure, because the async dispatcher will keep eating work from the queue whilst it is waiting for non-blocking I/O to complete, which could end up with a lot of work queued if we support using the threadpool for callbacks.
-- Leads to "max in flight" solutions that increment and decrement a counter for number of messages before we pause reading the queue
Alternatively, do we want a single threaded event loop
-- Easier to apply backpressure - only allow so many pending events in our queue
-- Thread affinity fixes some issues, such as HttpContext
-- Won't get you the same throughput, because the continuation will await the next message hitting non-blocking I/O or finishing with that message
Our preference is for the latter model, because it should be simpler to reason about, but it requires a custom synchronization context.