Skip to content

Refactor network-utils Connection type to return Reader/Writer directly instead of returning channels #1780

@coleFD

Description

@coleFD

The network-utils crate is very useful for developers, but currently it forces the implementation to spin up 2 async tasks and rely on async channels to communicate with client. This requires 2 sequential async awaits for every Tcp read and write which is not very performant. Instead, the crate should return the a type similar to a typical tcp stream type (one that implements the AsyncRead and AsyncWrite). In addition, the type returned should implement into_split() (see https://docs.rs/tokio/latest/tokio/net/struct.TcpStream.html#method.into_split), so that the user has the option to separate the reader and writer into different tasks if warranted.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Ready For Review 🔍

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions