Skip to content

core(actor_ref): rebuild from kameo reference — ActorRef / Weak / Recipient #117

Description

@joeldsouzax

Part of the core-rebuild epic — follows the shared rigor contract there.

Component

src/actor/actor_ref.rs (~3,008 LOC — the largest file). ActorRef, WeakActorRef, Recipient/ReplyRecipient, tell/ask entry points, strong/weak ref counting.

Learning & discussion

The handle you hold to talk to an actor. Last strong-ref drop → actor stops. Recipient is a type-erased handle for heterogeneous fan-in. At 3k LOC this file is doing too much — split into focused modules as part of the rebuild (ref + counting + recipient + entry).

Existing crates

Arc/Weak (std) — evaluate; possibly triomphe for a leaner Arc.

Research — best algorithm/approach

Strong/weak lifecycle → shutdown semantics; ref-count-driven stop; type-erasure for Recipient without vtable bloat.

Testing — hard as fuck

Lifecycle (last strong ref drop stops actor; weak upgrade after stop → None), linearizability (concurrent tell/ask/drop, snapshot assertions), defensive boundary. DST over ref drop/upgrade races. Mutation: cargo-mutants, zero survivors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions