Skip to content

libproxy: ability to Close(), expose NewLoopback()#583

Merged
djs55 merged 3 commits intomoby:masterfrom
djs55:mux-improvements
Jun 9, 2022
Merged

libproxy: ability to Close(), expose NewLoopback()#583
djs55 merged 3 commits intomoby:masterfrom
djs55:mux-improvements

Conversation

@djs55
Copy link
Copy Markdown
Collaborator

@djs55 djs55 commented Jun 1, 2022

  • Close() allows us to cleanly shutdown the multiplexer (similar to Close() on a net.Listener)
  • NewLoopback() satisfies the interface of the multiplexer, which makes it easier to write test cases in downstream projects

djs55 added 2 commits June 1, 2022 15:57
This is similar to calling Close() on a net.Listener to shut down the
operation.

Since this is an expected condition, don't log the debug ring in this
case.

Signed-off-by: David Scott <dave@recoil.org>
The NewLoopback() function returns a bidirectional buffered loopback
connection which satisfies the interface of the multiplexer, which is
convenient for tests which involve the multiplexer.

Signed-off-by: David Scott <dave@recoil.org>
@djs55 djs55 requested a review from fredericdalleau June 9, 2022 07:09
}
}

var _ io.ReadWriteCloser = &loopback{}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍 was looking for it in the main branch

Copy link
Copy Markdown
Collaborator

@fredericdalleau fredericdalleau left a comment

Choose a reason for hiding this comment

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

LGTM. I don't see a test that closes the mux though.

Signed-off-by: David Scott <dave@recoil.org>
@djs55 djs55 merged commit aa96713 into moby:master Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants