gio: Add a method to get a stream of incoming connections to SocketListener #1454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This object provides a
Stream
over which we can iterate in order to accept connections in an async environment.This is analogous to the one provided by async-std's
TcpListener
.This is an attempt at #1064. As I mention there, I think
SocketService
is the wrong abstraction to use in async so this is implemented forSocketListener
, so that thisincoming()
is by itself an alternative toSocketService
.The type that we return here feels pretty awkward but it's what this returns. The pattern with the source object feels like another instance of something that makes sense without easy async but with async Rust you'd create multiple objects? But maybe I don't see other use-cases for it here.