add streaming body to requests and responses #3

Merged
lx merged 64 commits from stream-body into main 2022-09-13 10:56:54 +00:00
4 changed files with 266 additions and 278 deletions
Showing only changes of commit 9bf29a7a18 - Show all commits

527
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -23,21 +23,21 @@ telemetry = ["opentelemetry", "opentelemetry-contrib"]
futures = "0.3.17" futures = "0.3.17"
pin-project = "1.0.10" pin-project = "1.0.10"
tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "sync", "time", "macros", "io-util", "signal"] } tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "sync", "time", "macros", "io-util", "signal"] }
tokio-util = { version = "0.6.8", default-features = false, features = ["compat", "io"] } tokio-util = { version = "0.7", default-features = false, features = ["compat", "io"] }
tokio-stream = "0.1.7" tokio-stream = "0.1.7"
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] } serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
rmp-serde = "0.14.3" rmp-serde = "0.15"
hex = "0.4.2" hex = "0.4.2"
rand = { version = "0.5.5" } rand = { version = "0.8" }
log = "0.4.8" log = "0.4.8"
arc-swap = "1.1" arc-swap = "1.1"
async-trait = "0.1.7" async-trait = "0.1.7"
err-derive = "0.2.3" err-derive = "0.3"
bytes = "1.2" bytes = "1.2"
lru = { version = "0.6", optional = true } lru = { version = "0.7", optional = true }
cfg-if = "1.0" cfg-if = "1.0"
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" } sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
@ -47,8 +47,7 @@ opentelemetry = { version = "0.17", optional = true }
opentelemetry-contrib = { version = "0.9", optional = true } opentelemetry-contrib = { version = "0.9", optional = true }
[dev-dependencies] [dev-dependencies]
env_logger = "0.8" env_logger = "0.9"
pretty_env_logger = "0.4"
structopt = { version = "0.3", default-features = false } structopt = { version = "0.3", default-features = false }
chrono = "0.4" chrono = "0.4"

View file

@ -138,7 +138,7 @@ impl BasaltView {
let mut ret = vec![]; let mut ret = vec![];
let mut rng = thread_rng(); let mut rng = thread_rng();
for _i in 0..count { for _i in 0..count {
let idx = rng.gen_range(0, possibles.len()); let idx = rng.gen_range(0..possibles.len());
ret.push(self.slots[possibles[idx]].peer.unwrap()); ret.push(self.slots[possibles[idx]].peer.unwrap());
} }
ret ret

View file

@ -14,7 +14,7 @@ use crate::NodeID;
#[tokio::test(flavor = "current_thread")] #[tokio::test(flavor = "current_thread")]
async fn test_with_basic_scheduler() { async fn test_with_basic_scheduler() {
pretty_env_logger::init(); env_logger::init();
run_test().await run_test().await
} }