diff --git a/README.md b/README.md index 99aa0e6f5..2de30e7e2 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ the Rust programming language. It is: [Website](https://tokio.rs) | [Guides](https://tokio.rs/docs/) | -[API Docs](https://docs.rs/tokio/0.2.0-alpha.1/tokio) | +[API Docs](https://docs.rs/tokio/0.2.0-alpha.2/tokio) | [Chat](https://gitter.im/tokio-rs/tokio) ## Overview @@ -40,16 +40,15 @@ asynchronous applications with the Rust programming language. At a high level, it provides a few major components: * A multithreaded, work-stealing based task [scheduler]. -* A [reactor] backed by the operating system's event queue (epoll, kqueue, +* A reactor backed by the operating system's event queue (epoll, kqueue, IOCP, etc...). * Asynchronous [TCP and UDP][net] sockets. These components provide the runtime components necessary for building an asynchronous application. -[net]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/net/index.html -[reactor]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/reactor/index.html -[scheduler]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/runtime/index.html +[net]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/net/index.html +[scheduler]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/runtime/index.html ## Example @@ -109,7 +108,7 @@ the [Tokio Gitter channel][chat]. We would be happy to try to answer your question. Last, if that doesn't work, try opening an [issue] with the question. [Guides]: https://tokio.rs/docs/ -[API documentation]: https://docs.rs/tokio/0.2.0-alpha.1/tokio +[API documentation]: https://docs.rs/tokio/0.2.0-alpha.2/tokio [chat]: https://gitter.im/tokio-rs/tokio [issue]: https://github.com/tokio-rs/tokio/issues/new diff --git a/tokio-codec/CHANGELOG.md b/tokio-codec/CHANGELOG.md index 55dcbcbfc..9ac27e64d 100644 --- a/tokio-codec/CHANGELOG.md +++ b/tokio-codec/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-codec/Cargo.toml b/tokio-codec/Cargo.toml index 98c96a38a..3c2c15396 100644 --- a/tokio-codec/Cargo.toml +++ b/tokio-codec/Cargo.toml @@ -7,20 +7,20 @@ name = "tokio-codec" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-codec/0.2.0-alpha.1/tokio_codec" +documentation = "https://docs.rs/tokio-codec/0.2.0-alpha.2/tokio_codec" description = """ Utilities for encoding and decoding frames. """ categories = ["asynchronous"] [dependencies] -tokio-io = { version = "=0.2.0-alpha.1", path = "../tokio-io" } +tokio-io = { version = "=0.2.0-alpha.2", path = "../tokio-io" } bytes = "0.4.7" futures-core-preview = "=0.3.0-alpha.18" @@ -28,7 +28,7 @@ futures-sink-preview = "=0.3.0-alpha.18" log = "0.4" [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } futures-util-preview = "=0.3.0-alpha.18" diff --git a/tokio-codec/src/lib.rs b/tokio-codec/src/lib.rs index b4f4a67c1..09baaebd0 100644 --- a/tokio-codec/src/lib.rs +++ b/tokio-codec/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-codec/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-codec/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-executor/CHANGELOG.md b/tokio-executor/CHANGELOG.md index 95fd8407b..067cb9640 100644 --- a/tokio-executor/CHANGELOG.md +++ b/tokio-executor/CHANGELOG.md @@ -1,3 +1,15 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Fixed +- allow running executor from within blocking clause (#1433). + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + +### Added +- Import `current-thread` executor (#1447). +- Import `threadpool` executor (#1152). + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-executor/Cargo.toml b/tokio-executor/Cargo.toml index d3edd0272..13f3e2fdc 100644 --- a/tokio-executor/Cargo.toml +++ b/tokio-executor/Cargo.toml @@ -7,9 +7,9 @@ name = "tokio-executor" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" -documentation = "https://docs.rs/tokio-executor/0.2.0-alpha.1/tokio_executor" +documentation = "https://docs.rs/tokio-executor/0.2.0-alpha.2/tokio_executor" repository = "https://github.com/tokio-rs/tokio" homepage = "https://github.com/tokio-rs/tokio" license = "MIT" @@ -36,7 +36,7 @@ threadpool = [ ] [dependencies] -tokio-sync = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-sync" } +tokio-sync = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-sync" } # current-thread dependencies crossbeam-channel = { version = "0.3.8", optional = true } @@ -53,8 +53,8 @@ lazy_static = { version = "1", optional = true } slab = { version = "0.4.1", optional = true } [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } futures-core-preview = "=0.3.0-alpha.18" rand = "0.7" diff --git a/tokio-executor/src/lib.rs b/tokio-executor/src/lib.rs index 0523731fc..22093732b 100644 --- a/tokio-executor/src/lib.rs +++ b/tokio-executor/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-executor/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-executor/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-fs/CHANGELOG.md b/tokio-fs/CHANGELOG.md index 6689a93c6..a00bffffc 100644 --- a/tokio-fs/CHANGELOG.md +++ b/tokio-fs/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-fs/Cargo.toml b/tokio-fs/Cargo.toml index 59db2fa81..121c657d6 100644 --- a/tokio-fs/Cargo.toml +++ b/tokio-fs/Cargo.toml @@ -7,14 +7,14 @@ name = "tokio-fs" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" readme = "README.md" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-fs/0.2.0-alpha.1/tokio_fs" +documentation = "https://docs.rs/tokio-fs/0.2.0-alpha.2/tokio_fs" description = """ Filesystem API for Tokio. """ @@ -22,14 +22,14 @@ keywords = ["tokio", "futures", "fs", "file", "async"] categories = ["asynchronous", "network-programming", "filesystem"] [dependencies] -tokio-io = { version = "=0.2.0-alpha.1", features = ["util"], path = "../tokio-io" } -tokio-executor = { version = "=0.2.0-alpha.1", features = ["threadpool"], path = "../tokio-executor" } +tokio-io = { version = "=0.2.0-alpha.2", features = ["util"], path = "../tokio-io" } +tokio-executor = { version = "=0.2.0-alpha.2", features = ["threadpool"], path = "../tokio-executor" } futures-core-preview = "=0.3.0-alpha.18" futures-util-preview = "=0.3.0-alpha.18" [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } rand = "0.7" tempfile = "3" diff --git a/tokio-fs/src/lib.rs b/tokio-fs/src/lib.rs index 4cb6fee58..7f445ca03 100644 --- a/tokio-fs/src/lib.rs +++ b/tokio-fs/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-fs/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-fs/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-io/CHANGELOG.md b/tokio-io/CHANGELOG.md index 572636baa..2c2540ec2 100644 --- a/tokio-io/CHANGELOG.md +++ b/tokio-io/CHANGELOG.md @@ -1,3 +1,12 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + +### Added +- Implement `AsyncWrite` for `Vec` (#1409). +- Add `BufReader`, `BufWriter` (#1438). + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-io/Cargo.toml b/tokio-io/Cargo.toml index 521ca2b7a..7b448455b 100644 --- a/tokio-io/Cargo.toml +++ b/tokio-io/Cargo.toml @@ -7,13 +7,13 @@ name = "tokio-io" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-io/0.2.0-alpha.1/tokio_io" +documentation = "https://docs.rs/tokio-io/0.2.0-alpha.2/tokio_io" description = """ Core I/O primitives for asynchronous I/O in Rust. """ @@ -30,7 +30,7 @@ memchr = { version = "2.2", optional = true } pin-utils = { version = "=0.1.0-alpha.4", optional = true } [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } futures-util-preview = "=0.3.0-alpha.18" diff --git a/tokio-io/src/lib.rs b/tokio-io/src/lib.rs index 0747905fb..fe2c3fc5d 100644 --- a/tokio-io/src/lib.rs +++ b/tokio-io/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-io/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-io/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-macros/Cargo.toml b/tokio-macros/Cargo.toml index 21e6ab9bb..800967483 100644 --- a/tokio-macros/Cargo.toml +++ b/tokio-macros/Cargo.toml @@ -7,13 +7,13 @@ name = "tokio-macros" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-macros/0.2.0-alpha.1/tokio_macros" +documentation = "https://docs.rs/tokio-macros/0.2.0-alpha.2/tokio_macros" description = """ Tokio's proc macros. """ @@ -29,4 +29,4 @@ quote = "1" syn = { version = "1", features = ["full"] } [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio", default-features = false, features = ["rt-full"] } +tokio = { version = "0.2.0-alpha.1", path = "../tokio", default-features = false, features = ["rt-full"] } diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs index a1024e565..7b72cca2d 100644 --- a/tokio-macros/src/lib.rs +++ b/tokio-macros/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-macros/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-macros/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-net/CHANGELOG.md b/tokio-net/CHANGELOG.md index 649f234db..b6ef6ee04 100644 --- a/tokio-net/CHANGELOG.md +++ b/tokio-net/CHANGELOG.md @@ -1,3 +1,16 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Renamed `tokio-net` from `tokio-reactor` (#1450). +- Switch `with_default(..., || )` to `set_default(...) -> Guard` (#1449). +- Update `futures` dependency to 0.3.0-alpha.18. + +### Added +- Import `tokio-tcp` (#1456). +- Import `tokio-udp` (#1459). +- Import `tokio-uds` (#1462). +- Import `tokio-signal` (#1463). + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-net/Cargo.toml b/tokio-net/Cargo.toml index f74cccb48..cd4666b6c 100644 --- a/tokio-net/Cargo.toml +++ b/tokio-net/Cargo.toml @@ -7,14 +7,14 @@ name = "tokio-net" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" readme = "README.md" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-net/0.2.0-alpha.1/tokio_net" +documentation = "https://docs.rs/tokio-net/0.2.0-alpha.2/tokio_net" description = """ Event loop that drives Tokio I/O resources. """ @@ -48,10 +48,10 @@ uds = [ ] [dependencies] -tokio-codec = { version = "=0.2.0-alpha.1", path = "../tokio-codec" } -tokio-executor = { version = "=0.2.0-alpha.1", path = "../tokio-executor" } -tokio-io = { version = "=0.2.0-alpha.1", path = "../tokio-io" } -tokio-sync = { version = "=0.2.0-alpha.1", path = "../tokio-sync" } +tokio-codec = { version = "=0.2.0-alpha.2", path = "../tokio-codec" } +tokio-executor = { version = "=0.2.0-alpha.2", path = "../tokio-executor" } +tokio-io = { version = "=0.2.0-alpha.2", path = "../tokio-io" } +tokio-sync = { version = "=0.2.0-alpha.2", path = "../tokio-sync" } # driver implementation crossbeam-utils = "0.6.0" @@ -81,8 +81,8 @@ features = ["consoleapi", "minwindef", "wincon"] optional = true [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } num_cpus = "1.8.0" tokio-io-pool = "0.1.4" diff --git a/tokio-net/src/lib.rs b/tokio-net/src/lib.rs index 6d6176996..310a15028 100644 --- a/tokio-net/src/lib.rs +++ b/tokio-net/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-net/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-net/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-process/Cargo.toml b/tokio-process/Cargo.toml index 1daeacf71..e75433ef6 100644 --- a/tokio-process/Cargo.toml +++ b/tokio-process/Cargo.toml @@ -23,18 +23,18 @@ categories = ["asynchronous"] futures-core-preview = "=0.3.0-alpha.18" futures-util-preview = "=0.3.0-alpha.18" log = "0.4" -tokio-io = { version = "=0.2.0-alpha.1", path = "../tokio-io", features = ["util"] } -tokio-net = { version = "=0.2.0-alpha.1", path = "../tokio-net" } +tokio-io = { version = "=0.2.0-alpha.2", path = "../tokio-io", features = ["util"] } +tokio-net = { version = "=0.2.0-alpha.2", path = "../tokio-net" } [dev-dependencies.tokio] -version = "=0.2.0-alpha.1" +version = "0.2.0-alpha.1" path = "../tokio" default-features = false features = ["codec", "rt-full"] [target.'cfg(windows)'.dependencies] mio-named-pipes = "0.1" -tokio-sync = { version = "=0.2.0-alpha.1", path = "../tokio-sync" } +tokio-sync = { version = "=0.2.0-alpha.2", path = "../tokio-sync" } [target.'cfg(windows)'.dependencies.winapi] version = "0.3" @@ -55,4 +55,4 @@ lazy_static = "1.3" libc = "0.2" log = "0.4" mio = "0.6.5" -tokio-net = { version = "=0.2.0-alpha.1", path = "../tokio-net", features = ["signal"] } +tokio-net = { version = "=0.2.0-alpha.2", path = "../tokio-net", features = ["signal"] } diff --git a/tokio-sync/CHANGELOG.md b/tokio-sync/CHANGELOG.md index f1b43f8fa..6181fb29e 100644 --- a/tokio-sync/CHANGELOG.md +++ b/tokio-sync/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + # 0.2.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-sync/Cargo.toml b/tokio-sync/Cargo.toml index 0c0597eb9..cf0cea9ba 100644 --- a/tokio-sync/Cargo.toml +++ b/tokio-sync/Cargo.toml @@ -7,7 +7,7 @@ name = "tokio-sync" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" @@ -29,8 +29,8 @@ futures-sink-preview = { version = "=0.3.0-alpha.18", optional = true } futures-util-preview = { version = "=0.3.0-alpha.18" } [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } env_logger = { version = "0.6", default-features = false } loom = { version = "0.2.1", features = ["futures"] } diff --git a/tokio-sync/src/lib.rs b/tokio-sync/src/lib.rs index 3e4f07b16..32970f959 100644 --- a/tokio-sync/src/lib.rs +++ b/tokio-sync/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-sync/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-sync/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-test/CHANGELOG.md b/tokio-test/CHANGELOG.md index de9a8f196..86c02b691 100644 --- a/tokio-test/CHANGELOG.md +++ b/tokio-test/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + # 0.2.0-alpha.1 (August 8, 2019) - Initial release diff --git a/tokio-test/Cargo.toml b/tokio-test/Cargo.toml index 7a4fa73f5..2a7fb83e7 100644 --- a/tokio-test/Cargo.toml +++ b/tokio-test/Cargo.toml @@ -7,24 +7,24 @@ name = "tokio-test" # - Cargo.toml # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-test/0.2.0-alpha.1/tokio_test" +documentation = "https://docs.rs/tokio-test/0.2.0-alpha.2/tokio_test" description = """ Testing utilities for Tokio- and futures-based code """ categories = ["asynchronous", "testing"] [dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-executor = { version = "=0.2.0-alpha.1", path = "../tokio-executor" } -tokio-io = { version = "=0.2.0-alpha.1", path = "../tokio-io" } -tokio-sync = { version = "=0.2.0-alpha.1", path = "../tokio-sync" } -tokio-timer = { version = "=0.3.0-alpha.1", path = "../tokio-timer" } +tokio = { version = "=0.2.0-alpha.2", path = "../tokio" } +tokio-executor = { version = "=0.2.0-alpha.2", path = "../tokio-executor" } +tokio-io = { version = "=0.2.0-alpha.2", path = "../tokio-io" } +tokio-sync = { version = "=0.2.0-alpha.2", path = "../tokio-sync" } +tokio-timer = { version = "=0.3.0-alpha.2", path = "../tokio-timer" } futures-core-preview = "=0.3.0-alpha.18" pin-convert = "0.1.0" diff --git a/tokio-test/src/lib.rs b/tokio-test/src/lib.rs index 4d13bf4de..92d1cfd21 100644 --- a/tokio-test/src/lib.rs +++ b/tokio-test/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-test/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-test/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, @@ -20,7 +20,7 @@ pub mod task; /// For more information, see the documentation for /// [`tokio::runtime::current_thread::Runtime::block_on`][runtime-block-on]. /// -/// [runtime-block-on]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/runtime/current_thread/struct.Runtime.html#method.block_on +/// [runtime-block-on]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/runtime/current_thread/struct.Runtime.html#method.block_on pub fn block_on(future: F) -> F::Output { let mut rt = tokio::runtime::current_thread::Runtime::new().unwrap(); rt.block_on(future) diff --git a/tokio-timer/CHANGELOG.md b/tokio-timer/CHANGELOG.md index 5349ed05b..02016a57d 100644 --- a/tokio-timer/CHANGELOG.md +++ b/tokio-timer/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.3.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. +- Switch `with_default(..., || )` to `set_default(...) -> Guard` (#1449). + # 0.3.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-timer/Cargo.toml b/tokio-timer/Cargo.toml index e08ce7b43..5cfa931e7 100644 --- a/tokio-timer/Cargo.toml +++ b/tokio-timer/Cargo.toml @@ -8,12 +8,12 @@ name = "tokio-timer" # - README.md # - Update CHANGELOG.md. # - Create "v0.3.x" git tag. -version = "0.3.0-alpha.1" +version = "0.3.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" readme = "README.md" -documentation = "https://docs.rs/tokio-timer/0.3.0-alpha.1/tokio_timer" +documentation = "https://docs.rs/tokio-timer/0.3.0-alpha.2/tokio_timer" repository = "https://github.com/tokio-rs/tokio" homepage = "https://github.com/tokio-rs/tokio" description = """ @@ -24,8 +24,8 @@ Timer facilities for Tokio async-traits = [] [dependencies] -tokio-executor = { version = "=0.2.0-alpha.1", path = "../tokio-executor" } -tokio-sync = { version = "=0.2.0-alpha.1", path = "../tokio-sync" } +tokio-executor = { version = "=0.2.0-alpha.2", path = "../tokio-executor" } +tokio-sync = { version = "=0.2.0-alpha.2", path = "../tokio-sync" } futures-core-preview = "=0.3.0-alpha.18" futures-util-preview = "=0.3.0-alpha.18" @@ -36,8 +36,8 @@ slab = "0.4.1" # optionals [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-sync = { version = "=0.2.0-alpha.1", path = "../tokio-sync", features = ["async-traits"] } -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio = { version = "0.2.0-alpha.1", path = "../tokio" } +tokio-sync = { version = "0.2.0-alpha.1", path = "../tokio-sync", features = ["async-traits"] } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } rand = "0.7" diff --git a/tokio-timer/src/lib.rs b/tokio-timer/src/lib.rs index 2e690c576..da046b07d 100644 --- a/tokio-timer/src/lib.rs +++ b/tokio-timer/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-timer/0.3.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-timer/0.3.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio-tls/CHANGELOG.md b/tokio-tls/CHANGELOG.md index 478237e1f..c69ac2116 100644 --- a/tokio-tls/CHANGELOG.md +++ b/tokio-tls/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. + # 0.3.0-alpha.1 (August 8, 2019) ### Changed diff --git a/tokio-tls/Cargo.toml b/tokio-tls/Cargo.toml index 6c1770097..746f187d1 100644 --- a/tokio-tls/Cargo.toml +++ b/tokio-tls/Cargo.toml @@ -8,13 +8,13 @@ name = "tokio-tls" # - README.md # - Update CHANGELOG.md. # - Create "v0.3.x" git tag. -version = "0.3.0-alpha.1" +version = "0.3.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-tls/0.3.0-alpha.1/tokio_tls/" +documentation = "https://docs.rs/tokio-tls/0.3.0-alpha.2/tokio_tls/" description = """ An implementation of TLS/SSL streams for Tokio giving an implementation of TLS for nonblocking I/O streams. @@ -26,11 +26,11 @@ travis-ci = { repository = "tokio-rs/tokio-tls" } [dependencies] native-tls = "0.2" -tokio-io = { version = "=0.2.0-alpha.1", path = "../tokio-io" } +tokio-io = { version = "=0.2.0-alpha.2", path = "../tokio-io" } [dev-dependencies] -tokio = { version = "=0.2.0-alpha.1", path = "../tokio" } -tokio-net = { version = "=0.2.0-alpha.1", path = "../tokio-net", features = ["tcp", "async-traits"] } +tokio = { version = "=0.2.0-alpha.2", path = "../tokio" } +tokio-net = { version = "=0.2.0-alpha.2", path = "../tokio-net", features = ["tcp", "async-traits"] } cfg-if = "0.1" env_logger = { version = "0.6", default-features = false } diff --git a/tokio-tls/src/lib.rs b/tokio-tls/src/lib.rs index 06b997ab7..38366c2a1 100644 --- a/tokio-tls/src/lib.rs +++ b/tokio-tls/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-tls/0.3.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio-tls/0.3.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs, diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 78b2677ef..f2d27f1dc 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,6 +1,16 @@ This changelog only applies to the `tokio` crate proper. Each sub crate maintains its own changelog tracking changes made in each respective sub crate. +# 0.2.0-alpha.2 (August 17, 2019) + +### Changed +- Update `futures` dependency to 0.3.0-alpha.18. +- Remove `reactor` module. + +### Added +- Add `BufReader` / `BufWriter` (#1438). +- Update `UdpFramed` to `std::future` (#1370). + # 0.2.0-alpha.1 (August 8, 2019) - Switch to `async`, `await`, and `std::future`. diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index bcfeb4a96..427f8bff0 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -8,7 +8,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v0.2.x" git tag. -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2018" authors = ["Tokio Contributors "] license = "MIT" @@ -62,18 +62,18 @@ futures-util-preview = { version = "=0.3.0-alpha.18", features = ["sink"] } # Everything else is optional... bytes = { version = "0.4", optional = true } num_cpus = { version = "1.8.0", optional = true } -tokio-codec = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-codec" } -tokio-fs = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-fs" } -tokio-io = { version = "=0.2.0-alpha.1", optional = true, features = ["util"], path = "../tokio-io" } -tokio-executor = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-executor" } -tokio-macros = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-macros" } -tokio-net = { version = "=0.2.0-alpha.1", optional = true, features = ["async-traits"], path = "../tokio-net" } -tokio-sync = { version = "=0.2.0-alpha.1", optional = true, path = "../tokio-sync", features = ["async-traits"] } -tokio-timer = { version = "=0.3.0-alpha.1", optional = true, path = "../tokio-timer", features = ["async-traits"] } +tokio-codec = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-codec" } +tokio-fs = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-fs" } +tokio-io = { version = "=0.2.0-alpha.2", optional = true, features = ["util"], path = "../tokio-io" } +tokio-executor = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-executor" } +tokio-macros = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-macros" } +tokio-net = { version = "=0.2.0-alpha.2", optional = true, features = ["async-traits"], path = "../tokio-net" } +tokio-sync = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-sync", features = ["async-traits"] } +tokio-timer = { version = "=0.3.0-alpha.2", optional = true, path = "../tokio-timer", features = ["async-traits"] } tracing-core = { version = "0.1", optional = true } [dev-dependencies] -tokio-test = { version = "=0.2.0-alpha.1", path = "../tokio-test" } +tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" } futures-preview = "=0.3.0-alpha.18" futures-util-preview = "=0.3.0-alpha.18" diff --git a/tokio/README.md b/tokio/README.md index 8cf2cd94a..2de30e7e2 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -1,5 +1,7 @@ # Tokio + _NOTE_: Tokio's [`master`](https://github.com/tokio-rs/tokio) branch is currently in the process of moving to [`std::future::Future`](https://doc.rust-lang.org/std/future/trait.Future.html), for `v0.1.x` based tokio releases please check out the [`v0.1.x`](https://github.com/tokio-rs/tokio/tree/v0.1.x) branch. + A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: @@ -20,7 +22,7 @@ the Rust programming language. It is: [crates-badge]: https://img.shields.io/crates/v/tokio.svg [crates-url]: https://crates.io/crates/tokio [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg -[mit-url]: LICENSE-MIT +[mit-url]: LICENSE [azure-badge]: https://dev.azure.com/tokio-rs/Tokio/_apis/build/status/tokio-rs.tokio?branchName=master [azure-url]: https://dev.azure.com/tokio-rs/Tokio/_build/latest?definitionId=1&branchName=master [gitter-badge]: https://img.shields.io/gitter/room/tokio-rs/tokio.svg @@ -28,7 +30,7 @@ the Rust programming language. It is: [Website](https://tokio.rs) | [Guides](https://tokio.rs/docs/) | -[API Docs](https://docs.rs/tokio/0.2.0-alpha.1/tokio) | +[API Docs](https://docs.rs/tokio/0.2.0-alpha.2/tokio) | [Chat](https://gitter.im/tokio-rs/tokio) ## Overview @@ -38,61 +40,65 @@ asynchronous applications with the Rust programming language. At a high level, it provides a few major components: * A multithreaded, work-stealing based task [scheduler]. -* A [reactor] backed by the operating system's event queue (epoll, kqueue, +* A reactor backed by the operating system's event queue (epoll, kqueue, IOCP, etc...). * Asynchronous [TCP and UDP][net] sockets. These components provide the runtime components necessary for building an asynchronous application. -[net]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/net/index.html -[reactor]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/reactor/index.html -[scheduler]: https://docs.rs/tokio/0.2.0-alpha.1/tokio/runtime/index.html +[net]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/net/index.html +[scheduler]: https://docs.rs/tokio/0.2.0-alpha.2/tokio/runtime/index.html ## Example A basic TCP echo server with Tokio: ```rust -use tokio::prelude::*; -use tokio::io::copy; +#![feature(async_await)] + use tokio::net::TcpListener; +use tokio::prelude::*; -fn main() { - // Bind the server's socket. - let addr = "127.0.0.1:12345".parse().unwrap(); - let listener = TcpListener::bind(&addr) - .expect("unable to bind TCP listener"); +#[tokio::main] +async fn main() -> Result<(), Box> { + let addr = "127.0.0.1:8080".parse()?; + let mut listener = TcpListener::bind(&addr).unwrap(); - // Pull out a stream of sockets for incoming connections - let server = listener.incoming() - .map_err(|e| eprintln!("accept failed = {:?}", e)) - .for_each(|sock| { - // Split up the reading and writing parts of the - // socket. - let (reader, writer) = sock.split(); + loop { + let (mut socket, _) = listener.accept().await?; - // A future that echos the data and returns how - // many bytes were copied... - let bytes_copied = copy(reader, writer); + tokio::spawn(async move { + let mut buf = [0; 1024]; - // ... after which we'll print what happened. - let handle_conn = bytes_copied.map(|amt| { - println!("wrote {:?} bytes", amt) - }).map_err(|err| { - eprintln!("IO error {:?}", err) - }); + // In a loop, read data from the socket and write the data back. + loop { + let n = match socket.read(&mut buf).await { + // socket closed + Ok(n) if n == 0 => return, + Ok(n) => n, + Err(e) => { + println!("failed to read from socket; err = {:?}", e); + return; + } + }; - // Spawn the future as a concurrent task. - tokio::spawn(handle_conn) + // Write the data back + if let Err(e) = socket.write_all(&buf[0..n]).await { + println!("failed to write to socket; err = {:?}", e); + return; + } + } }); - - // Start the Tokio runtime - tokio::run(server); + } } ``` -More examples can be found [here](examples). +More examples can be found [here](tokio/examples). Note that the `master` branch +is currently being updated to use `async` / `await`. The examples are +not fully ported. Examples for stable Tokio can be found +[here](https://github.com/tokio-rs/tokio/tree/v0.1.x/tokio/examples). + ## Getting Help @@ -101,9 +107,69 @@ First, see if the answer to your question can be found in the [Guides] or the the [Tokio Gitter channel][chat]. We would be happy to try to answer your question. Last, if that doesn't work, try opening an [issue] with the question. +[Guides]: https://tokio.rs/docs/ +[API documentation]: https://docs.rs/tokio/0.2.0-alpha.2/tokio [chat]: https://gitter.im/tokio-rs/tokio [issue]: https://github.com/tokio-rs/tokio/issues/new +## Contributing + +:balloon: Thanks for your help improving the project! We are so happy to have +you! We have a [contributing guide][guide] to help you get involved in the Tokio +project. + +[guide]: CONTRIBUTING.md + +## Project layout + +The `tokio` crate, found at the root, is primarily intended for use by +application developers. Library authors should depend on the sub crates, which +have greater guarantees of stability. + +The crates included as part of Tokio are: + +* [`tokio-executor`]: Task executors and related utilities. Includes a + single-threaded executor and a multi-threaded, work-stealing, executor. + +* [`tokio-fs`]: Filesystem (and standard in / out) APIs. + +* [`tokio-codec`]: Utilities for encoding and decoding protocol frames. + +* [`tokio-io`]: Asynchronous I/O related traits and utilities. + +* [`tokio-macros`]: Macros for usage with Tokio. + +* [`tokio-net`]: Event loop that drives I/O resources as well as TCP, UDP, and + unix domain socket apis. + +* [ `tokio-timer`]: Time related APIs. + +[`tokio-codec`]: tokio-codec +[`tokio-current-thread`]: tokio-current-thread +[`tokio-executor`]: tokio-executor +[`tokio-fs`]: tokio-fs +[`tokio-io`]: tokio-io +[`tokio-macros`]: tokio-macros +[`tokio-net`]: tokio-net +[`tokio-timer`]: tokio-timer + +## Related Projects + +In addition to the crates in this repository, the Tokio project also maintains +several other libraries, including: + +* [`tracing`] (formerly `tokio-trace`): A framework for application-level + tracing and async-aware diagnostics. + +* [`mio`]: A low-level, cross-platform abstraction over OS I/O APIs that powers + `tokio`. + +* [`bytes`]: Utilities for working with bytes, including efficient byte buffers. + +[`tracing`]: https://github.com/tokio-rs/tracing +[`mio`]: https://github.com/tokio-rs/mio +[`bytes`]: https://github.com/tokio-rs/bytes + ## Supported Rust Versions Tokio is built against the latest stable, nightly, and beta Rust releases. The diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index ec90d5ec1..d2701d337 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio/0.2.0-alpha.1")] +#![doc(html_root_url = "https://docs.rs/tokio/0.2.0-alpha.2")] #![warn( missing_debug_implementations, missing_docs,