RFC 016 Chunk 1: runtime introspection read primitive
snapshot() / actor_info() return owned ActorInfo over the slab: pid, names, fine-grained scheduling state, parent edge, trap flag, mailbox depth, and monitor/link/joiner counts. Pure reads, no hot-path change. - ActorState maps the packed slot word (no new storage); introspect.rs. - D1: RuntimeSnapshot carries SNAPSHOT_FORMAT_VERSION from day one. - D2: per-slot tearing (ps semantics); actor_info coherent per actor. - D3: mailbox depth included. Registry channels now stored behind an ErasedSender trait (downcast for clone_sender + type-erased queued_len); depth summed over published channels under the registry Leaf (Leaf -> Channel), kept out of the cold-lock pass so no two Leaves are ever held at once. Depth covers published channels only. - Done slots surface as root-less tombstones.
This commit is contained in:
@@ -137,6 +137,14 @@ impl<T> Drop for Receiver<T> {
|
||||
}
|
||||
|
||||
impl<T> Sender<T> {
|
||||
/// Number of messages currently queued behind this channel. Introspection
|
||||
/// only (RFC 016 mailbox depth); takes the channel lock, so callers reach
|
||||
/// it under the registry Leaf (Leaf → Channel) via the erased probe in
|
||||
/// `registry.rs`, never on a hot path.
|
||||
pub(crate) fn queued_len(&self) -> usize {
|
||||
self.inner.lock().queue.len()
|
||||
}
|
||||
|
||||
pub fn send(&self, value: T) -> Result<(), SendError<T>> {
|
||||
let unpark = {
|
||||
let mut g = self.inner.lock();
|
||||
|
||||
Reference in New Issue
Block a user