1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 06:09:02 +02:00

actix-rt-less (#408)

This commit is contained in:
Rob Ede
2021-11-04 20:30:43 +00:00
committed by GitHub
parent 81d7295486
commit 5b537c7b10
18 changed files with 1075 additions and 844 deletions

View File

@ -240,6 +240,15 @@ impl Arbiter {
})
}
/// Try to get current running arbiter handle.
///
/// Returns `None` if no Arbiter has been started.
///
/// Unlike [`current`](Self::current), this never panics.
pub fn try_current() -> Option<ArbiterHandle> {
HANDLE.with(|cell| cell.borrow().clone())
}
/// Stop Arbiter from continuing it's event loop.
///
/// Returns true if stop message was sent successfully and false if the Arbiter has been dropped.

View File

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