Documentation
¶
Overview ¶
Package pending implements a process-local rendezvous between workflow and activity task waiters and the completions reported by the application. Under WorkflowsClusteredDeployment the waiter always runs on the daprd hosting the workflow or activity actor, and the executor rendezvous actor is placed on that same host because it shares the actor ID (placement hashes only the actor ID). Registering the waiter here lets a completion arriving on this host, either directly or via the executor actor, be delivered in-process without a watch stream.
Index ¶
- type Pending
- func (p *Pending) Cancel(key string) bool
- func (p *Pending) CancelDeferred(key string) (run func(), ok bool)
- func (p *Pending) Deliver(key string, data []byte) bool
- func (p *Pending) DeliverDeferred(key string, data []byte) (run func(), ok bool)
- func (p *Pending) Len() int
- func (p *Pending) RegisterCallback(key string, cb func(Result)) func()
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pending ¶
type Pending struct {
// contains filtered or unexported fields
}
func (*Pending) Cancel ¶
Cancel cancels the waiter registered for key, reporting whether a waiter was present, with the same deregistration semantics as Deliver.
func (*Pending) CancelDeferred ¶
CancelDeferred is Cancel with the DeliverDeferred contract.
func (*Pending) Deliver ¶
Deliver hands a completion to the waiter registered for key, reporting whether a waiter was present. The waiter stays registered (see RegisterCallback) and its callback runs on the calling goroutine before Deliver returns.
func (*Pending) DeliverDeferred ¶
DeliverDeferred is Deliver for callers holding their own locks: the waiter's invocation is returned as run for the caller to execute after releasing them.
func (*Pending) RegisterCallback ¶
RegisterCallback adds a callback waiter for the given execution key and returns a deregister function. The callback runs on the goroutine delivering the completion or cancellation, never with the registry lock held. A registration STAYS ARMED across deliveries and is removed only by its deregister function (or by being superseded): the consumer may discard a delivery as stale (durabletask's completion-token guard) and keep waiting, so consuming the registration on delivery would strand the genuine completion with nowhere to land. The callback may therefore run more than once; the consumer's arbiter settles exactly one delivery. A superseded waiter's cancellation runs on the registering goroutine.