-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from halzy/halzy/3-SendAll
feat: #3 Improve efficiency of outgoing packets.
- Loading branch information
Showing
15 changed files
with
1,101 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.git | ||
.rgignore | ||
.gitignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
[package] | ||
name = "stream_multiplexer" | ||
version = "0.1.0" | ||
version = "0.2.0" | ||
authors = ["Benjamin Halsted <[email protected]>"] | ||
edition = "2018" | ||
license = "MIT OR Apache-2.0" | ||
|
||
categories = ["asynchronous", "network-programming"] | ||
description = "Combines many streams into a few." | ||
documentation = "https://docs.rs/stream_multiplexer" | ||
keywords = ["async", "asynchronous", "multiplex", "stream", "tokio"] | ||
readme = "README.md" | ||
repository = "https://github.com/halzy/stream_multiplexer" | ||
|
||
[dependencies] | ||
byteorder = "1.3" | ||
bytes = "0.5" | ||
futures = { version = "0.3", default-features = false, features = ["alloc"] } | ||
thiserror = "1.0" | ||
tokio = { version = "0.2", features = ["full"] } | ||
tokio-util = { version = "0.2", features = ["codec"] } | ||
tracing = { version = "0.1", features = ["log"] } | ||
byteorder = "1.3" | ||
bytes = "0.5" | ||
tracing-futures = "0.2" | ||
|
||
[dev-dependencies] | ||
tokio = { version = "0.2", features = ["full", "test-util"] } | ||
matches = "0.1" | ||
tracing-subscriber = "0.2" | ||
futures = { version = "0.3", default-features = false, features = ["alloc","std"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
# stream_multiplexer | ||
|
||
 | ||
 | ||
[![Build Status][actions_badge]][actions] | ||
[![Latest Version][crates_badge]][crates] | ||
[![Rust Documentation][docs_badge]][docs] | ||
|
||
Highly unstable API! | ||
|
||
This library multiplexes many streams into fewer streams. | ||
New streams are assigned an identifier. Data from those streams are wrapped in a data structure that contains the Id and Bytes, and then funneled into another stream. | ||
|
||
[docs_badge]: https://docs.rs/stream_multiplexer/badge.svg | ||
[docs]: https://docs.rs/stream_multiplexer | ||
[crates_badge]: https://img.shields.io/crates/v/stream_multiplexer.svg | ||
[crates]: https://crates.io/crates/stream_multiplexer | ||
[actions_badge]: https://github.com/halzy/stream_multiplexer/workflows/Rust/badge.svg | ||
[actions]: https://github.com/halzy/stream_multiplexer/actions | ||
|
||
// FIXME: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/// A collection of errors that can be returned. | ||
#[derive(thiserror::Error, Debug)] | ||
pub enum MultiplexerError { | ||
// /// Sending can fail to enqueue a message to a stream. | ||
// #[error("Could not send to the stream")] | ||
// Send(#[from] tokio::sync::mpsc::error::TrySendError<Result<OutgoingMessage<OV>, ()>>), | ||
// | ||
// FIXME: outgoing error stream ? | ||
// /// If the stream that is trying to be sent to has gone away | ||
// #[error("Sending to nonexistent stream {0}")] | ||
// SendNoStream(StreamId), | ||
|
||
// #[error("Sending to full stream {0}")] | ||
// StreamFull(StreamId), | ||
|
||
// #[error("Sending to full stream {0}")] | ||
// StreamClosed(StreamId), | ||
/// Wrapper around std::io::Error | ||
#[error("IoError")] | ||
IoError(#[from] std::io::Error), | ||
|
||
/// Nothing to see here | ||
#[error("Should never happen")] | ||
UnitError, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.