Skip to content

Commit

Permalink
feat: Implement half-duplex streaming (#38)
Browse files Browse the repository at this point in the history
Implements streaming the CAR file that's generated in a response and consuming a response CAR stream.

This is not doing full-duplex streaming yet, but the difference shouldn't be too big.

This has helped cold sync in appa a lot, since it reduces the amount of round-trips to one and streams all bytes needed for sync in one go.

---

* feat: Implement streaming

* fix: Good 'ol 1-character bug

* chore: Switch tests to use `TestResult` and `test_log`

* feat: Add useful trace msgs

* refactor: Re-use streaming impl for non-streaming impl

* chore: Write docs
  • Loading branch information
matheus23 authored Jan 24, 2024
1 parent b22fb94 commit 122f369
Show file tree
Hide file tree
Showing 8 changed files with 336 additions and 208 deletions.
95 changes: 65 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions car-mirror/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ doc = true

[dependencies]
anyhow = "1.0"
async-stream = "0.3.5"
async-trait = "0.1.73"
bytes = "1.4"
deterministic-bloom = "0.1"
Expand All @@ -40,16 +39,17 @@ serde_ipld_dagcbor = "0.4"
thiserror = "1.0"
tokio = { version = "^1", default-features = false }
tracing = "0.1"
tracing-subscriber = "0.3"
wnfs-common = "0.1.26"

[dev-dependencies]
async-std = { version = "1.11", features = ["attributes"] }
car-mirror = { path = ".", features = ["test_utils"] }
proptest = "1.1"
roaring-graphs = "0.12"
test-log = { version = "0.2", default-features = false, features = ["trace"] }
test-strategy = "0.3"
testresult = "0.3.0"
testresult = "0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "parking_lot", "registry"] }

[features]
default = []
Expand Down
Loading

0 comments on commit 122f369

Please sign in to comment.