Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

don't start a Go routine for every connection dialed #252

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

marten-seemann
Copy link
Collaborator

In the swarm, we're calling Close for every connection before it is garbage collected. We therefore don't need to start a Go routine here just to see when a connection is closed.
We now also increment the reuse counter every time a connection is dialed. This simplifies closing the connection.

Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

nice, no need to spawn that goroutine.

In the swarm, we're calling Close for every connection before it is garbage
collected. We therefore don't need to start a Go routine here just to see when
a connection is closed.
We now also increment the reuse counter every time a connection is dialed. This
simplifies closing the connection.
@marten-seemann marten-seemann merged commit 2c63830 into master Jan 8, 2022
@marten-seemann marten-seemann deleted the optimize-connection-close branch January 14, 2022 11:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants