mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
prepare rt v2.0.0-beta.3
This commit is contained in:
parent
0b656f51e1
commit
057e7cd7c9
@ -1,6 +1,9 @@
|
||||
# Changes
|
||||
|
||||
## Unreleased - 2021-xx-xx
|
||||
|
||||
|
||||
## 2.0.0-beta.3 - 2021-01-31
|
||||
* Remove `run_in_tokio`, `attach_to_tokio` and `AsyncSystemRunner`. [#253]
|
||||
* Return `JoinHandle` from `actix_rt::spawn`. [#253]
|
||||
* Remove old `Arbiter::spawn`. Implementation is now inlined into `actix_rt::spawn`. [#253]
|
||||
|
@ -1,7 +1,10 @@
|
||||
[package]
|
||||
name = "actix-rt"
|
||||
version = "2.0.0-beta.2"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
version = "2.0.0-beta.3"
|
||||
authors = [
|
||||
"Nikolay Kim <fafhrd91@gmail.com>",
|
||||
"Rob Ede <robjtede@icloud.com>",
|
||||
]
|
||||
description = "Tokio-based single-thread async runtime for the Actix ecosystem"
|
||||
keywords = ["network", "framework", "async", "futures"]
|
||||
homepage = "https://actix.rs"
|
||||
|
7
actix-rt/README.md
Normal file
7
actix-rt/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# actix-rt
|
||||
|
||||
> Tokio-based single-thread async runtime for the Actix ecosystem.
|
||||
|
||||
See documentation for detailed explanations these components: [https://docs.rs/actix-rt][docs].
|
||||
|
||||
[docs]: https://docs.rs/actix-rt
|
@ -1,4 +1,37 @@
|
||||
//! Tokio-based single-thread async runtime for the Actix ecosystem.
|
||||
//!
|
||||
//! In most parts of the the Actix ecosystem, it has been chosen to use !Send futures. For this
|
||||
//! reason, a single-threaded runtime is appropriate since it is guaranteed that futures will not
|
||||
//! be moved between threads. This can result in small performance improvements over cases where
|
||||
//! atomics would otherwise be needed.
|
||||
//!
|
||||
//! To achieve similar performance to multi-threaded, work-stealing runtimes, applications
|
||||
//! using `actix-rt` will create multiple, mostly disconnected, single-threaded runtimes.
|
||||
//! This approach has good performance characteristics for workloads where the majority of tasks
|
||||
//! have similar runtime expense.
|
||||
//!
|
||||
//! The disadvantage is that idle threads will not steal work from very busy, stuck or otherwise
|
||||
//! backlogged threads. Tasks that are disproportionately expensive should be offloaded to the
|
||||
//! blocking thread-pool using [`task::spawn_blocking`].
|
||||
//!
|
||||
//! # Examples
|
||||
//! ```
|
||||
//! use std::sync::mpsc;
|
||||
//! use actix_rt::{Arbiter, System};
|
||||
//!
|
||||
//! let _ = System::new();
|
||||
//!
|
||||
//! let (tx, rx) = mpsc::channel::<u32>();
|
||||
//!
|
||||
//! let arbiter = Arbiter::new();
|
||||
//! arbiter.spawn_fn(move || tx.send(42).unwrap());
|
||||
//!
|
||||
//! let num = rx.recv().unwrap();
|
||||
//! assert_eq!(num, 42);
|
||||
//!
|
||||
//! arbiter.stop();
|
||||
//! arbiter.join().unwrap();
|
||||
//! ```
|
||||
|
||||
#![deny(rust_2018_idioms, nonstandard_style)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
Loading…
Reference in New Issue
Block a user