Skip to content

Commit

Permalink
Add async-I/O support to the crate
Browse files Browse the repository at this point in the history
* Add an optional `tokio` feature to enable
* Add `AsyncRead` and `AsyncWrite` trait implementations where appropriate.
* Add a few misc methods for appropriate use with async
* Avoid use of methods like `write_all` which aren't async-compatible.

Currently the gzip `Read`-based streams do not implement `AsyncRead` due to the
necessity for a large implementation overhaul if doing so.

Closes rust-lang#91
Closes rust-lang#92
Closes rust-lang#93
  • Loading branch information
alexcrichton committed Apr 11, 2017
1 parent a3a6752 commit 9abf34f
Show file tree
Hide file tree
Showing 9 changed files with 677 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ script:
- cargo build --verbose
- cargo test --verbose
- cargo test --verbose --features zlib
- cargo test --verbose --features tokio
- cargo test --verbose --features 'tokio zlib'
- cargo test --verbose --features zlib --no-default-features
- cargo clean && cargo build
- rustdoc --test README.md -L target/debug -L target/debug/deps
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ streams.
libc = "0.2"
miniz-sys = { path = "miniz-sys", version = "0.1.7", optional = true }
libz-sys = { version = "1.0", optional = true }
tokio-io = { version = "0.1", optional = true }
futures = { version = "0.1", optional = true }

[dev-dependencies]
rand = "0.3"
quickcheck = { version = "0.4", default-features = false }
tokio-core = "0.1"

[features]
default = ["miniz-sys"]
zlib = ["libz-sys"]
tokio = ["tokio-io", "futures"]
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ build: false

test_script:
- cargo test --verbose --target %TARGET%
- cargo test --verbose --target %TARGET% --features tokio
Loading

0 comments on commit 9abf34f

Please sign in to comment.