From 602db1779eb51d60e0fe5a33d725d1d7fdf540fd Mon Sep 17 00:00:00 2001 From: Bo Yao Date: Mon, 24 Feb 2020 21:55:02 -0800 Subject: [PATCH] Expose is_set (#99) * Expose is_set * Update doc and changes.md --- actix-rt/CHANGES.md | 4 ++++ actix-rt/src/system.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 7c7ad63d..a7792455 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [TBD] - [TBD] + +- Expose `System::is_set` to check if current system is running + ## [1.0.0] - 2019-12-11 * Update dependencies diff --git a/actix-rt/src/system.rs b/actix-rt/src/system.rs index 383471cd..1e5beec7 100644 --- a/actix-rt/src/system.rs +++ b/actix-rt/src/system.rs @@ -79,8 +79,8 @@ impl System { }) } - /// Set current running system. - pub(crate) fn is_set() -> bool { + /// Check if current system is running. + pub fn is_set() -> bool { CURRENT.with(|cell| cell.borrow().is_some()) }