Skip to content

Conversation

@ignoxx
Copy link

@ignoxx ignoxx commented Jan 19, 2026

Problem

Currently, ctx.Child() requires the full PID.ID (e.g., "parent/1/worker/123") to find a child actor. This is counter-intuitive because:

  1. SpawnChild(producer, "worker", WithID("123")) accepts kind and id separately
  2. Users naturally expect ctx.Child("worker/123") to work when called from the parent actor
  3. The current behavior requires users to manually construct the full path

Related issue: #168

Solution

This PR modifies Child() to first try an exact match (for backward compatibility), then try prepending the parent's PID.ID to support the intuitive "kind/id" format.

Usage

// Spawn a child
ctx.SpawnChild(producer, "worker", WithID("123"))
// Now both work:
ctx.Child("worker/123")                    // ✅ New intuitive way
ctx.Child("parent/1/worker/123")           // ✅ Still works (backward compatible)

Previously, ctx.Child() required the full PID.ID to find a child,
which was counter-intuitive.
This change allows ctx.Child('kind/id') to work as expected while
maintaining backward compatibility with full PID.ID lookups.
@ignoxx
Copy link
Author

ignoxx commented Jan 29, 2026

@tralafiti @anthdm would be nice to have this merged :D

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.

1 participant