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
- ctx.PipeTo: Run
taskin a goroutine; on success, send the result toto. On failure, behavior depends on options. - ctx.PipeToName: Same, but target is resolved by name (location-transparent).
From PID
- pid.PipeTo: Run
task; deliver result toto. The sender (pid) is used for context. - pid.PipeToName: Same, target by name.
From GrainContext
- gctx.PipeToGrain: Deliver result to a grain.
- gctx.PipeToActor: Deliver result to a named actor.
- gctx.PipeToSelf: Deliver result to this grain.
*StatusFailure message to the target grain
instead of going to the dead-letter queue. PipeToActor follows the actor semantics below. See
Grain PipeTo for the grain-side API and example.
Task signature
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).
Task signature
PipeOption
- WithTimeout: Abort delivery if the task does not complete within
d. - WithCircuitBreaker: 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
Example
*http.Response (or the task fails and the error is handled per options).