Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Commit

Permalink
[tokio] update code to tokio 1
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Jan 27, 2021
1 parent e46037d commit 9df33b9
Show file tree
Hide file tree
Showing 8 changed files with 340 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
features: ['', 'futures03', 'tokio02', 'quickcheck1', 'futures03 quickcheck1', 'tokio02 quickcheck1']
features: ['', 'futures03', 'tokio1', 'quickcheck1', 'futures03 quickcheck1', 'tokio1 quickcheck1']
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Changed
- Updated to tokio 1.0.

## [0.4.0] - 2020-09-24
### Changed
- Updated to quickcheck 0.9, tokio 0.2 and futures 0.3.
Expand Down
47 changes: 31 additions & 16 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ exclude = [

[dependencies]
futures = { version = "0.3", optional = true }
pin-project = { version = "1.0.4", optional = true }
quickcheck = { version = "1.0.3", optional = true }
rand = { version = "0.8", features = ["getrandom", "small_rng"], optional = true }
bytes = { version = "0.5.6", optional = true }
pin-project = { version = "1.0.4", optional = true }
tokio = { version = "0.2", optional = true, features = ["io-util", "rt-core"] }
tokio = { version = "1.1.0", optional = true }

[dev-dependencies]
itertools = "0.10.0"
lazy_static = "1"
quickcheck = "1.0.3"
tokio = { version = "0.2", features = ["io-util", "macros", "rt-core", "rt-threaded"] }
tokio = { version = "1.1.0", features = ["io-util", "macros", "rt-multi-thread"] }

[[example]]
name = "buggy_write"
required-features = ["quickcheck1"]

[features]
futures03 = ["futures", "pin-project"]
tokio02 = ["futures03", "tokio", "bytes"]
tokio1 = ["futures03", "tokio"]
quickcheck1 = ["quickcheck", "rand"]

[badges]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This library provides:
* `PartialRead` and `PartialWrite`, which wrap existing `Read` and
`Write` implementations and allow specifying arbitrary behavior on the
next `read`, `write` or `flush` call.
* With the optional `futures03` and `tokio02` features, `PartialAsyncRead` and
* With the optional `futures03` and `tokio1` features, `PartialAsyncRead` and
`PartialAsyncWrite` to wrap existing `AsyncRead` and `AsyncWrite`
implementations. These implementations are task-aware, so they will know
how to pause and unpause tasks if they return a `WouldBlock` error.
Expand All @@ -29,7 +29,7 @@ issues include:
* A partial read or write, even without an error, might leave the wrapper
in an invalid state ([example fix][1]).

With the `AsyncRead` and `AsyncWrite` provided by `futures03` and `tokio02`:
With the `AsyncRead` and `AsyncWrite` provided by `futures03` and `tokio1`:

* A call to `read_to_end` or `write_all` within the wrapper might be partly
successful but then error out. These functions will return the error
Expand Down
Loading

0 comments on commit 9df33b9

Please sign in to comment.