Skip to content

Commit 924e5a3

Browse files
committed
Merge remote-tracking branch 'origin/master' into flat_map_fixed
2 parents 2323ac9 + 5c2a3de commit 924e5a3

File tree

154 files changed

+2711
-2090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+2711
-2090
lines changed

.github/workflows/ci.yml

+86-15
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ jobs:
2929
toolchain: ${{ matrix.rust }}
3030
override: true
3131

32+
- name: Cache cargo registry
33+
uses: actions/cache@v2
34+
with:
35+
path: ~/.cargo/registry
36+
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
37+
38+
- name: Cache cargo index
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.cargo/git
42+
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
43+
44+
- name: Cache cargo build
45+
uses: actions/cache@v2
46+
with:
47+
path: target
48+
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}
49+
3250
- name: check
3351
uses: actions-rs/cargo@v1
3452
with:
@@ -40,6 +58,15 @@ jobs:
4058
with:
4159
command: check
4260
args: --features unstable --all --bins --examples --tests
61+
62+
- name: check wasm
63+
uses: actions-rs/cargo@v1
64+
with:
65+
command: check
66+
target: wasm32-unknown-unknown
67+
override: true
68+
args: --features unstable --all --bins --tests
69+
4370
- name: check bench
4471
uses: actions-rs/cargo@v1
4572
if: matrix.rust == 'nightly'
@@ -65,11 +92,67 @@ jobs:
6592
command: test
6693
args: --all --features "unstable attributes"
6794

68-
- name: documentation test
95+
build__with_no_std:
96+
name: Build with no-std
97+
runs-on: ubuntu-latest
98+
99+
steps:
100+
- uses: actions/checkout@master
101+
102+
- name: setup
103+
run: |
104+
rustup default nightly
105+
rustup target add thumbv7m-none-eabi
106+
107+
- name: check no_std
69108
uses: actions-rs/cargo@v1
70109
with:
71-
command: test
72-
args: --doc --features "unstable attributes"
110+
command: check
111+
args: --no-default-features --features alloc --target thumbv7m-none-eabi -Z avoid-dev-deps
112+
113+
check_tokio_02_feature:
114+
name: Check tokio02 feature
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@master
118+
- name: check tokio02
119+
uses: actions-rs/cargo@v1
120+
with:
121+
command: check
122+
args: --all --features tokio02
123+
124+
cross:
125+
name: Cross compile
126+
runs-on: ubuntu-latest
127+
strategy:
128+
matrix:
129+
target:
130+
- i686-unknown-linux-gnu
131+
- powerpc-unknown-linux-gnu
132+
- powerpc64-unknown-linux-gnu
133+
- mips-unknown-linux-gnu
134+
- arm-linux-androideabi
135+
136+
steps:
137+
- uses: actions/checkout@master
138+
139+
- name: Install nightly
140+
uses: actions-rs/toolchain@v1
141+
with:
142+
toolchain: nightly
143+
override: true
144+
145+
- name: Install cross
146+
run: cargo install cross
147+
148+
- name: check
149+
run: cross check --all --target ${{ matrix.target }}
150+
151+
- name: check unstable
152+
run: cross check --all --features unstable --target ${{ matrix.target }}
153+
154+
- name: test
155+
run: cross test --all --features unstable --target ${{ matrix.target }}
73156

74157
check_fmt_and_docs:
75158
name: Checking fmt and docs
@@ -98,15 +181,3 @@ jobs:
98181

99182
- name: Docs
100183
run: cargo doc --features docs
101-
102-
# clippy_check:
103-
# name: Clippy check
104-
# runs-on: ubuntu-latest
105-
# steps:
106-
# - uses: actions/checkout@v1
107-
# - name: Install rust
108-
# run: rustup update beta && rustup default beta
109-
# - name: Install clippy
110-
# run: rustup component add clippy
111-
# - name: clippy
112-
# run: cargo clippy --all --features unstable

CHANGELOG.md

+101-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,101 @@ and this project adheres to [Semantic Versioning](https://book.async.rs/overview
77

88
## [Unreleased]
99

10+
# [1.6.1] - 2020-06-11
11+
12+
## Added
13+
14+
- Added `tokio02` feature flag, to allow compatability usage with [email protected] ([#804](https://github.com/async-rs/async-std/pull/804)).
15+
16+
## Changed
17+
18+
- Removed unstable `stdio` lock methods, due to their unsoundness ([#807](https://github.com/async-rs/async-std/pull/807)).
19+
20+
## Fixed
21+
22+
- Fixed wrong slice index for file reading ([#802](https://github.com/async-rs/async-std/pull/802)).
23+
- Fixed recursive calls to `block_on` ([#799](https://github.com/async-rs/async-std/pull/799)) and ([#809](https://github.com/async-rs/async-std/pull/809)).
24+
- Remove `default` feature requirement for the `unstable` feature ([#806](https://github.com/async-rs/async-std/pull/806)).
25+
26+
# [1.6.0] - 2020-05-22
27+
28+
See `1.6.0-beta.1` and `1.6.0-beta.2`.
29+
30+
# [1.6.0-beta.2] - 2020-05-19
31+
32+
## Added
33+
34+
- Added an environment variable to configure the thread pool size of the runtime. ([#774](https://github.com/async-rs/async-std/pull/774))
35+
- Implement `Clone` for `UnixStream` ([#772](https://github.com/async-rs/async-std/pull/772))
36+
37+
## Changed
38+
39+
- For `wasm`, switched underlying `Timer` implementation to [`futures-timer`](https://github.com/async-rs/futures-timer). ([#776](https://github.com/async-rs/async-std/pull/776))
40+
41+
## Fixed
42+
43+
- Use `smol::block_on` to handle drop of `File`, avoiding nested executor panic. ([#768](https://github.com/async-rs/async-std/pull/768))
44+
45+
# [1.6.0-beta.1] - 2020-05-07
46+
47+
## Added
48+
49+
- Added `task::spawn_local`. ([#757](https://github.com/async-rs/async-std/pull/757))
50+
- Added out of the box support for `wasm`. ([#757](https://github.com/async-rs/async-std/pull/757))
51+
- Added `JoinHandle::cancel` ([#757](https://github.com/async-rs/async-std/pull/757))
52+
- Added `sync::Condvar` ([#369](https://github.com/async-rs/async-std/pull/369))
53+
- Added `sync::Sender::try_send` and `sync::Receiver::try_recv` ([#585](https://github.com/async-rs/async-std/pull/585))
54+
- Added `no_std` support for `task`, `future` and `stream` ([#680](https://github.com/async-rs/async-std/pull/680))
55+
56+
## Changed
57+
58+
- Switched underlying runtime to [`smol`](https://github.com/stjepang/smol/). ([#757](https://github.com/async-rs/async-std/pull/757))
59+
- Switched implementation of `sync::Barrier` to use `sync::Condvar` like `std` does. ([#581](https://github.com/async-rs/async-std/pull/581))
60+
61+
## Fixed
62+
63+
- Allow compilation on 32 bit targets, by using `AtomicUsize` for `TaskId`. ([#756](https://github.com/async-rs/async-std/pull/756))
64+
65+
# [1.5.0] - 2020-02-03
66+
67+
[API Documentation](https://docs.rs/async-std/1.5.0/async-std)
68+
69+
This patch includes various quality of life improvements to async-std.
70+
Including improved performance, stability, and the addition of various
71+
`Clone` impls that replace the use of `Arc` in many cases.
72+
73+
## Added
74+
75+
- Added links to various ecosystem projects from the README ([#660](https://github.com/async-rs/async-std/pull/660))
76+
- Added an example on `FromStream` for `Result<T, E>` ([#643](https://github.com/async-rs/async-std/pull/643))
77+
- Added `stream::pending` as "unstable" ([#615](https://github.com/async-rs/async-std/pull/615))
78+
- Added an example of `stream::timeout` to document the error flow ([#675](https://github.com/async-rs/async-std/pull/675))
79+
- Implement `Clone` for `DirEntry` ([#682](https://github.com/async-rs/async-std/pull/682))
80+
- Implement `Clone` for `TcpStream` ([#689](https://github.com/async-rs/async-std/pull/689))
81+
82+
## Changed
83+
84+
- Removed internal comment on `stream::Interval` ([#645](https://github.com/async-rs/async-std/pull/645))
85+
- The "unstable" feature can now be used without requiring the "default" feature ([#647](https://github.com/async-rs/async-std/pull/647))
86+
- Removed unnecessary trait bound on `stream::FlatMap` ([#651](https://github.com/async-rs/async-std/pull/651))
87+
- Updated the "broadcaster" dependency used by "unstable" to `1.0.0` ([#681](https://github.com/async-rs/async-std/pull/681))
88+
- Updated `async-task` to 1.2.1 ([#676](https://github.com/async-rs/async-std/pull/676))
89+
- `task::block_on` now parks after a single poll, improving performance in many cases ([#684](https://github.com/async-rs/async-std/pull/684))
90+
- Improved reading flow of the "client" part of the async-std tutorial ([#550](https://github.com/async-rs/async-std/pull/550))
91+
- Use `take_while` instead of `scan` in `impl` of `Product`, `Sum` and `FromStream` ([#667](https://github.com/async-rs/async-std/pull/667))
92+
- `TcpStream::connect` no longer uses a thread from the threadpool, improving performance ([#687](https://github.com/async-rs/async-std/pull/687))
93+
94+
## Fixed
95+
96+
- Fixed crate documentation typo ([#655](https://github.com/async-rs/async-std/pull/655))
97+
- Fixed documentation for `UdpSocket::recv` ([#648](https://github.com/async-rs/async-std/pull/648))
98+
- Fixed documentation for `UdpSocket::send` ([#671](https://github.com/async-rs/async-std/pull/671))
99+
- Fixed typo in stream documentation ([#650](https://github.com/async-rs/async-std/pull/650))
100+
- Fixed typo on `sync::JoinHandle` documentation ([#659](https://github.com/async-rs/async-std/pull/659))
101+
- Removed use of `std::error::Error::description` which failed CI ([#661](https://github.com/async-rs/async-std/pull/662))
102+
- Removed the use of rustfmt's unstable `format_code_in_doc_comments` option which failed CI ([#685](https://github.com/async-rs/async-std/pull/685))
103+
- Fixed a code typo in the `task::sleep` example ([#688](https://github.com/async-rs/async-std/pull/688))
104+
10105
# [1.4.0] - 2019-12-20
11106

12107
[API Documentation](https://docs.rs/async-std/1.4.0/async-std)
@@ -637,7 +732,12 @@ task::blocking(async {
637732

638733
- Initial beta release
639734

640-
[Unreleased]: https://github.com/async-rs/async-std/compare/v1.3.0...HEAD
735+
[Unreleased]: https://github.com/async-rs/async-std/compare/v1.6.1...HEAD
736+
[1.6.1]: https://github.com/async-rs/async-std/compare/v1.6.0...v1.6.1
737+
[1.6.0]: https://github.com/async-rs/async-std/compare/v1.5.0...v1.6.0
738+
[1.6.0-beta.2]: https://github.com/async-rs/async-std/compare/v1.6.0-beta.1...v1.6.0-beta.2
739+
[1.6.0-beta.1]: https://github.com/async-rs/async-std/compare/v1.5.0...v1.6.0-beta.1
740+
[1.5.0]: https://github.com/async-rs/async-std/compare/v1.4.0...v1.5.0
641741
[1.4.0]: https://github.com/async-rs/async-std/compare/v1.3.0...v1.4.0
642742
[1.3.0]: https://github.com/async-rs/async-std/compare/v1.2.0...v1.3.0
643743
[1.2.0]: https://github.com/async-rs/async-std/compare/v1.1.0...v1.2.0

Cargo.toml

+47-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[package]
22
name = "async-std"
3-
version = "1.4.0"
3+
version = "1.6.1"
44
authors = [
55
"Stjepan Glavina <[email protected]>",
66
"Yoshua Wuyts <[email protected]>",
7+
"Friedel Ziegelmayer <[email protected]>",
78
"Contributors to async-std",
89
]
910
edition = "2018"
@@ -24,57 +25,72 @@ rustdoc-args = ["--cfg", "feature=\"docs\""]
2425
default = [
2526
"std",
2627
"async-task",
27-
"crossbeam-channel",
28-
"crossbeam-deque",
29-
"futures-timer",
3028
"kv-log-macro",
3129
"log",
32-
"mio",
33-
"mio-uds",
3430
"num_cpus",
3531
"pin-project-lite",
32+
"smol",
3633
]
3734
docs = ["attributes", "unstable", "default"]
38-
unstable = ["std", "broadcaster", "futures-timer"]
35+
unstable = [
36+
"std",
37+
"futures-timer",
38+
]
3939
attributes = ["async-attributes"]
4040
std = [
41+
"alloc",
4142
"crossbeam-utils",
42-
"futures-core",
43+
"futures-core/std",
4344
"futures-io",
4445
"memchr",
4546
"once_cell",
46-
"pin-project-lite",
4747
"pin-utils",
4848
"slab",
49+
"wasm-bindgen-futures",
50+
"futures-channel",
4951
]
52+
alloc = [
53+
"futures-core/alloc",
54+
"pin-project-lite",
55+
]
56+
tokio02 = ["smol/tokio02"]
5057

5158
[dependencies]
5259
async-attributes = { version = "1.1.1", optional = true }
53-
async-task = { version = "1.0.0", optional = true }
54-
broadcaster = { version = "0.2.6", optional = true, default-features = false, features = ["default-channels"] }
55-
crossbeam-channel = { version = "0.4.0", optional = true }
56-
crossbeam-deque = { version = "0.7.2", optional = true }
57-
crossbeam-utils = { version = "0.7.0", optional = true }
58-
futures-core = { version = "0.3.1", optional = true }
59-
futures-io = { version = "0.3.1", optional = true }
60-
futures-timer = { version = "2.0.2", optional = true }
60+
async-task = { version = "3.0.0", optional = true }
61+
crossbeam-utils = { version = "0.7.2", optional = true }
62+
futures-core = { version = "0.3.4", optional = true, default-features = false }
63+
futures-io = { version = "0.3.4", optional = true }
6164
kv-log-macro = { version = "1.0.4", optional = true }
6265
log = { version = "0.4.8", features = ["kv_unstable"], optional = true }
63-
memchr = { version = "2.2.1", optional = true }
64-
mio = { version = "0.6.19", optional = true }
65-
mio-uds = { version = "0.6.7", optional = true }
66-
num_cpus = { version = "1.11.1", optional = true }
67-
once_cell = { version = "1.2.0", optional = true }
68-
pin-project-lite = { version = "0.1.1", optional = true }
66+
memchr = { version = "2.3.3", optional = true }
67+
num_cpus = { version = "1.12.0", optional = true }
68+
once_cell = { version = "1.3.1", optional = true }
69+
pin-project-lite = { version = "0.1.4", optional = true }
6970
pin-utils = { version = "0.1.0-alpha.4", optional = true }
7071
slab = { version = "0.4.2", optional = true }
72+
futures-timer = { version = "3.0.2", optional = true }
73+
74+
# Devdepencency, but they are not allowed to be optional :/
75+
surf = { version = "1.0.3", optional = true }
76+
77+
[target.'cfg(not(target_os = "unknown"))'.dependencies]
78+
smol = { version = "0.1.11", optional = true }
79+
80+
[target.'cfg(target_arch = "wasm32")'.dependencies]
81+
futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }
82+
wasm-bindgen-futures = { version = "0.4.10", optional = true }
83+
futures-channel = { version = "0.3.4", optional = true }
84+
85+
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
86+
wasm-bindgen-test = "0.3.10"
7187

7288
[dev-dependencies]
7389
femme = "1.3.0"
74-
rand = "0.7.2"
75-
surf = "1.0.3"
90+
rand = "0.7.3"
7691
tempdir = "0.3.7"
77-
futures = "0.3.1"
92+
futures = "0.3.4"
93+
rand_xorshift = "0.2.0"
7894

7995
[[test]]
8096
name = "stream"
@@ -83,3 +99,8 @@ required-features = ["unstable"]
8399
[[example]]
84100
name = "tcp-ipv4-and-6-echo"
85101
required-features = ["unstable"]
102+
103+
[[example]]
104+
name = "surf-web"
105+
required-features = ["surf"]
106+

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<br />
99

1010
<div align="center">
11+
<!-- CI status -->
12+
<a href="https://github.com/async-rs/async-std/actions">
13+
<img src="https://github.com/async-rs/async-std/workflows/CI/badge.svg"
14+
alt="CI Status" />
15+
</a>
1116
<!-- Crates version -->
1217
<a href="https://crates.io/crates/async-std">
1318
<img src="https://img.shields.io/crates/v/async-std.svg?style=flat-square"
@@ -134,6 +139,10 @@ documentation] on how to enable them.
134139

135140
* [Surf](https://crates.io/crates/surf) — Surf the web. Surf is a friendly **HTTP client** built for casual Rustaceans and veterans alike.
136141

142+
* [Xactor](https://crates.io/crates/xactor) — Xactor is a rust actors framework based on async-std.
143+
144+
* [async-graphql](https://crates.io/crates/async-graphql) — A GraphQL server library implemented in rust, with full support for async/await.
145+
137146
## License
138147

139148
<sup>

docs/src/SUMMARY.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
- [Clean Shutdown](./tutorial/clean_shutdown.md)
2020
- [Handling Disconnection](./tutorial/handling_disconnection.md)
2121
- [Implementing a Client](./tutorial/implementing_a_client.md)
22-
- [TODO: Async Patterns](./patterns.md)
22+
- [Async Patterns](./patterns.md)
2323
- [TODO: Collected Small Patterns](./patterns/small-patterns.md)
24+
- [Production-Ready Accept Loop](./patterns/accept-loop.md)
2425
- [Security practices](./security/index.md)
2526
- [Security Disclosures and Policy](./security/policy.md)
2627
- [Glossary](./glossary.md)

0 commit comments

Comments
 (0)