wait

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 10 Imported by: 2 modules, 1 package

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.

README

Wait node

Type: wait
Category: Flow Control

Durably parks messages until a distributed notify signal reaches its target count.

Behavior

This node is registered as wait and runs as part of a workflow. Its exact runtime behavior is implemented in node.go; this document summarizes the editor-facing purpose and configuration contract.

Configuration

Field Type Default Description
mergeMode string wait-wins Notification Metadata Merge — wait-wins keeps waiting-message metadata on key conflicts; notify-wins lets cached notification metadata overwrite it
pollIntervalMs number 500 Poll Interval Milliseconds — How often the deployed wait node checks the durable coordination store; lower values react faster but cost more queries
signal string Release Signal — Fixed text or a mustache template such as {{payload.id}}; the evaluated value is trimmed and becomes the global distributed signal key; keys are case-sensitive and shared across workflows
targetCount string 1 Target Signal Count — Fixed positive integer or a mustache template that evaluates to one; exactly this many signal increments are consumed on release
timeoutSeconds number 0 Wait Timeout Seconds — 0 waits indefinitely; positive values route the parked message to output_2 when the wait expires

Implementation

  • node.go contains the executor, validation, schema, and registration.
  • editor.html contains the editor integration.
  • node_test.go, when present, contains behavioral tests.

Documentation

Overview

Package wait contains the distributed wait node: it durably parks messages until a shared notify signal reaches its target count.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Signal         string      `json:"signal"`
	TargetCount    interface{} `json:"targetCount"`
	TimeoutSeconds interface{} `json:"timeoutSeconds"`
	MergeMode      string      `json:"mergeMode"`
	PollIntervalMS interface{} `json:"pollIntervalMs"`
}

Config holds the wait node configuration.

type Node

type Node struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

Node parks and releases distributed waiters.

func NewNode

func NewNode(node nodestore.NodeInterface, cfg *Config, host nodebase.NodeHost) *Node

NewNode creates a wait node.

func (*Node) Activate

func (n *Node) Activate(ctx context.Context) error

Activate starts the node's single lifecycle-managed poller. Parking never creates a goroutine per message; this cancellable poller is what makes restart-recovered and cross-runner waiters observable to the flow.

func (*Node) Execute

Execute evaluates the signal and target count, then persists the whole message as a waiter. It returns nil immediately: the message is parked in the coordination store, not held in this traversal goroutine.

func (*Node) Stop

func (n *Node) Stop() error

Stop cancels the poller. Parked rows deliberately remain in the durable store so a later deploy/restart can resume them.

func (*Node) StopKey

func (n *Node) StopKey() string

StopKey dedupes stopper registration for executor shells of one node.

func (*Node) Validate

func (n *Node) Validate() error

Validate fails deployment early when the host offers no durable coordination store. There is deliberately no in-memory fallback.

Jump to

Keyboard shortcuts

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