http-rs / http-rs/http-types

Suggestion: Use `oneshot::channel` instead of `async_std::channel`

Open
#329 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
209
Forks
91
PR merge metrics
No merged PRs in 30d

Description

There are a couple of places where a one-time channel is needed:
- Upgrading a connection
- Sending/receiving trailers

Currently these wrap the channel from async_std, but it would simplify things if they wrapped `oneshot::channel` from futures (or other similar channel) instead, as that channel offers the following benefits:

- Simpler implementation and less synchronization, since only two tasks are involved.
- Send function does not need to be async.

Since this is a breaking change to the signature of `send`, it should be done for the next major release.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.