queue

package
v0.19.903 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PauseHandlerName  string = "pause"
	ResumeHandlerName string = "resume"
)
View Source
const (
	ReadyHandlerName string = "ready"
	ReadyHandlerType        = handlerTypeQuery
)
View Source
const (
	QueueStatusReady          = "ready"
	QueueStatusRestartPending = "restart-pending"
	QueueStatusRestarted      = "restarted"
	QueueStatusForceRestarted = "force-restarted"
	QueueStatusIdle           = "idle"
	QueueStatusStopped        = "stopped"
)
View Source
const (
	StatusHandlerName string = "status"
	StatusHandlerType        = handlerTypeUpdate
)
View Source
const DirectExecuteUpdateName string = "direct-execute"
View Source
const EnqueueUpdateName string = "enqueue"
View Source
const ForceRestartUpdateName string = "force-restart"
View Source
const RestartUpdateName string = "restart"
View Source
const StopUpdateName string = "stop"

Variables

View Source
var ErrSignalNoop = errors.New("queue signal already in terminal state")

ErrSignalNoop is returned when a signal has already been processed (e.g. via direct-execute) and the dispatcher encounters it again. Callers should check for this error and skip gracefully.

Functions

This section is empty.

Types

type DirectExecuteRequest added in v0.19.901

type DirectExecuteRequest struct {
	QueueSignalID string `json:"queue_signal_id"`
}

type DirectExecuteResponse added in v0.19.901

type DirectExecuteResponse struct {
	QueueSignalID string `json:"queue_signal_id"`
}

type EnqueueHandlerInput added in v0.19.850

type EnqueueHandlerInput struct {
	QueueSignalID string `json:"queue_signal_id"`
	WorkflowID    string `json:"workflow_id"`
}

EnqueueHandlerInput is the input to the enqueue update handler. The QueueSignal is created in the DB by the client before sending this update, so the handler only needs the IDs to start the handler workflow and queue the ref.

type EnqueueResponse

type EnqueueResponse struct {
	ID         string
	WorkflowID string
}

type ForceRestartRequest added in v0.19.901

type ForceRestartRequest struct{}

type ForceRestartResponse added in v0.19.901

type ForceRestartResponse struct{}

type Params

type Params struct {
	fx.In

	Cfg *internal.Config
	V   *validator.Validate
}

type PauseRequest added in v0.19.850

type PauseRequest struct{}

type PauseResponse added in v0.19.850

type PauseResponse struct{}

type QueueRef

type QueueRef struct {
	WorkflowID string
	ID         string
}

type QueueState

type QueueState struct {
	QueueRefs        []QueueRef
	Paused           bool
	LastActivityTime time.Time
}

QueueState is the data that is passed between continue-as-news

type QueueWorkflowRequest

type QueueWorkflowRequest struct {
	QueueID string
	Version string

	ReleaseWindow *ReleaseWindow

	State *QueueState
}

type ReadyResponse

type ReadyResponse struct {
	Ready bool
}

type ReleaseWindow added in v0.19.850

type ReleaseWindow struct {
	// Days of the week (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
	Days []string
	// StartTime in HH:MM format
	StartTime string
	// EndTime in HH:MM format
	EndTime string
	// Timezone (e.g. "America/New_York")
	Timezone string
}

func (*ReleaseWindow) IsOpen added in v0.19.850

func (w *ReleaseWindow) IsOpen(t time.Time) bool

func (*ReleaseWindow) NextOpenTime added in v0.19.850

func (w *ReleaseWindow) NextOpenTime(t time.Time) time.Time

NextOpenTime returns the next time the window opens. If the window is currently open, it returns the current time.

type RestartRequest

type RestartRequest struct{}

type RestartResponse

type RestartResponse struct{}

type ResumeRequest added in v0.19.850

type ResumeRequest struct{}

type ResumeResponse added in v0.19.850

type ResumeResponse struct{}

type StatusRequest

type StatusRequest struct{}

type StatusResponse

type StatusResponse struct {
	Ready   bool
	Stopped bool
	Paused  bool

	QueueDepthCount int
	InFlightCount   int
	InFlight        []string
}

type StopRequest

type StopRequest struct{}

type StopResponse

type StopResponse struct{}

type Workflows

type Workflows struct {
	StartupHooks []func(workflow.Context, QueueWorkflowRequest) error
	// contains filtered or unexported fields
}

func NewWorkflows

func NewWorkflows(params Params) (*Workflows, error)

func (*Workflows) All

func (q *Workflows) All() []any

func (*Workflows) Queue

@temporal-gen-v2 workflow @task-queue "queue" @id-template queue-{{.QueueID}} @memo type queue

Directories

Path Synopsis
allsignals
Package allsignals imports all signal packages to trigger their init() registrations into the signal catalog.
Package allsignals imports all signal packages to trigger their init() registrations into the signal catalog.
db

Jump to

Keyboard shortcuts

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