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

refactor(swarm): don't use task_event_buffer_size for pending connections #3187

Merged
merged 4 commits into from
Dec 14, 2022

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Dec 2, 2022

Description

The task for a pending connection only ever sends one event into this channel: Either a success or a failure. Cloning a sender adds one slot to the capacity of the channel. Hence, we can start this capacity at 0 and have the cloning of the Sender take care of properly increasing the capacity.

Notes

This is a first step towards #3186 by removing one use of this parameter.

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

The task for a pending connection only ever sends one event into this
channel: Either a success or a failure. Cloning a sender adds one
slot to the capacity of the channel. Hence, we can start this capacity
at 0 and have the `cloning` of the `Sender` take care of properly
increasing the capacity.
@thomaseizinger thomaseizinger changed the title chore(swarm): don't use task_event_buffer_size for pending connections refactor(swarm): don't use task_event_buffer_size for pending connections Dec 2, 2022
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Change looks good to me. We could even go as far as using a oneshot here.

@thomaseizinger
Copy link
Contributor Author

Change looks good to me. We could even go as far as using a oneshot here.

That would make it more difficult to listen for the events although a SelectAll<Receiver> could do the trick.

@mergify mergify bot merged commit 15ad798 into master Dec 14, 2022
@thomaseizinger thomaseizinger deleted the 3186-no-buffer-size-pending-connections branch December 19, 2022 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants