hooks

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncMatchOutcome

type SyncMatchOutcome int

SyncMatchOutcome describes the outcome of a sync match attempt from the hook's perspective.

const (
	// Default zero value; should not be used explicitly.
	SyncMatchOutcomeUnspecified SyncMatchOutcome = iota
	// The task was not sync-matched. Catch-all for reasons not covered by more specific outcomes.
	SyncMatchOutcomeNotMatched
	// The task was sync-matched successfully.
	SyncMatchOutcomeSuccess
	// A poller was available but rate limiting blocked the match.
	SyncMatchOutcomeRateLimited
)

type TaskAddHookDetails

type TaskAddHookDetails struct {
	DeploymentVersion *deploymentpb.WorkerDeploymentVersion
	IsSyncMatch       bool // Deprecated: use SyncMatchOutcome instead.
	SyncMatchOutcome  SyncMatchOutcome
}

type TaskHook

type TaskHook interface {
	// Start is called when the task queue partition manager for the hooks partition is started
	Start()
	// Stop is called when the task queue partition manager for the hooks partition is stopped
	Stop()
	// ProcessTaskAdd is called for each Task addition (whether sync or async matching)
	ProcessTaskAdd(ctx context.Context, event *TaskAddHookDetails)
}

type TaskHookFactory

type TaskHookFactory interface {
	// Create returns a TaskHook instance that will be leveraged as part
	// of the specific task queue partition (as specified in the details).
	// This might also return nil, if no hooking into that task queue
	// partition is desired.
	Create(details *TaskHookFactoryCreateDetails) TaskHook
}

type TaskHookFactoryCreateDetails

type TaskHookFactoryCreateDetails struct {
	Namespace *namespace.Namespace
	Partition TaskQueuePartition
}

type TaskQueuePartition

type TaskQueuePartition interface {
	NamespaceId() string
	TaskQueue() *tqid.TaskQueue
	TaskType() enumspb.TaskQueueType
	Kind() enumspb.TaskQueueKind
}

TaskQueuePartition is a simplified version of tqid.Partition that removes details the hooks should not concern themselves with

Jump to

Keyboard shortcuts

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