pending

package
v1.19.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 New

func New() *Pending

func (*Pending) Cancel

func (p *Pending) Cancel(key string) bool

Cancel cancels the waiter registered for key, reporting whether a waiter was present, with the same deregistration semantics as Deliver.

func (*Pending) CancelDeferred

func (p *Pending) CancelDeferred(key string) (run func(), ok bool)

CancelDeferred is Cancel with the DeliverDeferred contract.

func (*Pending) Deliver

func (p *Pending) Deliver(key string, data []byte) bool

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

func (p *Pending) DeliverDeferred(key string, data []byte) (run func(), ok bool)

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) Len

func (p *Pending) Len() int

func (*Pending) RegisterCallback

func (p *Pending) RegisterCallback(key string, cb func(Result)) func()

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.

type Result

type Result struct {
	Data      []byte
	Cancelled bool
}

Result is a delivered task completion. Data is the raw marshaled ActivityResponse or WorkflowResponse; Cancelled reports that the task was cancelled instead of completed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL