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

substream-set: Poll substreams fairly with poll indexes #228

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lexnv
Copy link
Collaborator

@lexnv lexnv commented Sep 3, 2024

This PR refactors the substream-set (used by request-response protocols):

  • the context waker is saved to before returning poll::pending
  • a poll index and vec is introduced to provide more fairness during the polling of substreams

@lexnv lexnv added the enhancement New feature or request label Sep 3, 2024
@lexnv lexnv self-assigned this Sep 3, 2024
@lexnv
Copy link
Collaborator Author

lexnv commented Sep 4, 2024

I'll do more testing with this PR since one test is failing because we expect fewer polls to happen

@lexnv
Copy link
Collaborator Author

lexnv commented Sep 23, 2024

In this revision, I've replaced the HashMap ++ Vec<Keys> with an indexMap::IndexMap.

One test was previously failing due to the poll_index not incrementing properly

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

Successfully merging this pull request may close these issues.

1 participant