-
Notifications
You must be signed in to change notification settings - Fork 3
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
Send signals in parallel #51
Send signals in parallel #51
Conversation
This PR is now based against the master branch to allow CI to do it's job. I will rebase it later. |
c988ab8
to
5eb92fa
Compare
It seems I cannot now change the base branch for this PR :( |
Ok, Github has fixed this issue I suppose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few idiomatic suggestions and a missing doc comment, otherwise LGTM
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This should likely be more useful outside the context of Polkadot maybe, because a subsystem not handling signals in time is likely stuck because of cycles or other bugs.
* Add benchmarks * Move thread-pool feature to dev dependencies * Allow to use both async-channel and futures channels via feature flags (#48) * Allow to select between channels implementations * Fix tests * Add futures-channel tests in CI * Fix check job * feat: send signals in parallel (#51) Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> --------- Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Fix merge issue * Another version fix --------- Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This PR addresses #18
Rough architecture description.
try_send_signal
for each subsystem. This is not an async function and it is blazingly fast for the vast majority of the cases. So it is a fast path.send_signal
function.FuturesUnordered
to allow unordered polling. When some subsystem gets ready to accept a signal it immediately receives that signal.With such an approach, we do not create unnecessary futures nor vectors of futures and we just utilise the fast path via
try_send
in the majority of this function calls.