Skip to main content
A PID is the sole actor reference in GoAkt. It is a live handle to a running actor—either local (same process) or remote (another node). All messaging goes through a PID.

Role

Local vs Remote

Use pid.IsLocal() or pid.IsRemote() when location matters. pid.ActorSystem() returns nil for remote PIDs—guard before use.

Key methods

Obtaining a PID

  • Spawnsystem.Spawn(ctx, name, actor) returns a local PID.
  • ActorOfsystem.ActorOf(ctx, name) returns local or remote PID.
  • Contextctx.Self() (current actor), ctx.Sender() (message sender).

NoSender

system.NoSender() returns a special PID for messages without a sender (e.g., scheduled messages, external clients). Use it when sending from outside the actor system. NoSender().Path() may be used for wire encoding.