pid.PipeTo or ctx.PipeTo when the sender (pid or ctx.Self()) is a remote PID returns ErrNotLocal. The task runs in a goroutine on the callerβs node; remote PIDs do not have a local execution context to run it.
API
From ReceiveContext
| Method | Purpose |
|---|---|
ctx.PipeTo(to, task, opts...) | Run task in a goroutine; on success, send the result to to. On failure, behavior depends on options. |
ctx.PipeToName(actorName, task, opts...) | Same, but target is resolved by name (location-transparent). |
From PID
| Method | Purpose |
|---|---|
pid.PipeTo(ctx, to, task, opts...) | Run task; deliver result to to. The sender (pid) is used for context. |
pid.PipeToName(ctx, actorName, task, opts...) | Same, target by name. |
From GrainContext
| Method | Purpose |
|---|---|
gctx.PipeToGrain(to, task, opts...) | Deliver result to a grain. |
gctx.PipeToActor(actorName, task, opts...) | Deliver result to a named actor. |
gctx.PipeToSelf(task, opts...) | Deliver result to this grain. |
Task signature
- On success: the
anyresult is sent to the target as a normal message. - On failure: the error is forwarded to the dead-letter queue, unless
WithCircuitBreakeris used and the breaker is open (in which case the outcome is dropped).
PipeOption
| Option | Purpose |
|---|---|
WithTimeout(d) | Abort delivery if the task does not complete within d. |
WithCircuitBreaker(cb) | If the circuit breaker is open, do not deliver; drop the outcome. |
WithTimeout or WithCircuitBreaker may be used per call. Using both returns ErrOnlyOneOptionAllowed.
Example
*http.Response (or the task fails and the error is handled per options).