vin_core/detail.rs
1use std::{sync::atomic::AtomicUsize, collections::HashMap};
2use tokio::sync::Notify;
3use crate::{ActorId, WeakErasedAddr};
4use lazy_static::lazy_static;
5
6pub use super::{Forwarder, WrappedMessage};
7
8/// Global actor shutdown signal.
9pub static SHUTDOWN_SIGNAL: Notify = Notify::const_new();
10
11/// Number of actors alive.
12pub static ACTORS_ALIVE: AtomicUsize = AtomicUsize::new(0);
13
14lazy_static! {
15 /// An actor registry that is queriable via `query_actor()` and `query_actor_erased()`.
16 pub static ref REGISTRY: std::sync::Mutex<HashMap<ActorId, WeakErasedAddr>> = Default::default();
17}