Skip to content

Conversation

@tqwewe
Copy link
Owner

@tqwewe tqwewe commented Dec 5, 2025

Adds the following new methods to WeakActorRef:

  • is_current
  • kill
  • wait_for_startup variants
  • wait_for_shutdown variants
  • unlink variants
  • mailbox_sender methods

Omits link creation and remote registration methods as these create lifecycle commitments inappropriate for weak reference semantics.

The wait_for_shutdown methods has a very slight possible behavioral difference with those from ActorRef, in that tokio's mpsc::WeakSender doesn't expose a .closed() method, like mpsc::Sender has. However, it still waits for the internal shutdown result to be set, which is effectively the same.

Closes #266

@tqwewe tqwewe force-pushed the feat/weak-actor-ref-methods branch from 332256d to a960b36 Compare December 5, 2025 04:05
@tqwewe tqwewe added this to the 0.20.0 milestone Dec 5, 2025
@tqwewe tqwewe merged commit 7535935 into main Dec 6, 2025
46 checks passed
@tqwewe tqwewe deleted the feat/weak-actor-ref-methods branch December 6, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to wait for an Actor to fully complete shutdown when closed by dropping all ActorRef references?

2 participants