update rt changelog

This commit is contained in:
Rob Ede 2021-11-03 13:59:35 +00:00
parent 36a61469e4
commit 010b557492
4 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,9 @@
# Changes # Changes
## Unreleased - 2021-xx-xx ## Unreleased - 2021-xx-xx
* Add `Arbiter::try_current` for situations where thread may or may not have Arbiter context. [#408]
[#408]: https://github.com/actix/actix-net/pull/408
## 2.3.0 - 2021-10-11 ## 2.3.0 - 2021-10-11

View File

@ -244,7 +244,7 @@ impl Arbiter {
/// ///
/// Returns `None` if no Arbiter has been started. /// Returns `None` if no Arbiter has been started.
/// ///
/// Contrary to [`current`](Self::current), this never panics. /// Unlike [`current`](Self::current), this never panics.
pub fn try_current() -> Option<ArbiterHandle> { pub fn try_current() -> Option<ArbiterHandle> {
HANDLE.with(|cell| cell.borrow().clone()) HANDLE.with(|cell| cell.borrow().clone())
} }

View File

@ -130,7 +130,7 @@ impl System {
/// ///
/// Returns `None` if no System has been started. /// Returns `None` if no System has been started.
/// ///
/// Contrary to [`current`](Self::current), this never panics. /// Unlike [`current`](Self::current), this never panics.
pub fn try_current() -> Option<System> { pub fn try_current() -> Option<System> {
CURRENT.with(|cell| cell.borrow().clone()) CURRENT.with(|cell| cell.borrow().clone())
} }

View File

@ -260,7 +260,7 @@ impl ServerInner {
self.waker_queue.wake(WakerInterest::Stop); self.waker_queue.wake(WakerInterest::Stop);
// stop workers // stop workers
let stop = self let workers_stop = self
.worker_handles .worker_handles
.iter() .iter()
.map(|worker| worker.stop(graceful)) .map(|worker| worker.stop(graceful))
@ -269,7 +269,7 @@ impl ServerInner {
Some(Box::pin(async move { Some(Box::pin(async move {
if graceful { if graceful {
// wait for all workers to shut down // wait for all workers to shut down
let _ = join_all(stop).await; let _ = join_all(workers_stop).await;
} }
if let Some(tx) = completion { if let Some(tx) = completion {