wait-notify

command
v0.8.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: 14 Imported by: 0 modules, 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.

README

Wait Notify

A noderun workflow demonstrating the distributed coordination pair — one branch parks a message, another releases it:

inject → wait (signal "job-1") → debug
inject → notify (signal "job-1")

The branches never meet in the graph: the wait node parks its message against a global signal key, and the notify node increments that key in a durable coordination store. When the count reaches the wait's targetCount, the parked message is released downstream.

Things to notice:

  • Coordination is order-independent and durable: if the notify ran first, the count would be stored and the waiter would consume it immediately — a surviving waiter even resumes across engine restarts.
  • The engine needs stores wired explicitly — there is no in-memory fallback: engine.CoordinationStore = noderun.NewNeatCoordinationStore(db) and engine.DurableInboxStore = noderun.NewNeatInboxStore(db) over a sqlite database.
  • signal accepts a mustache template like {{payload.id}}, so the waiter's identity can come from the message. Keys are global — shared across workflows and runners.
  • targetCount is the number of signal increments a release consumes: "2" means two notifiers must arrive. timeoutSeconds routes an expired wait to output_2 instead of waiting forever.
  • notify's cacheKeys copies chosen message metadata into the signal cache; mergeMode on the wait side decides whether cached notification metadata overrides the waiting message's own fields.

Run from the noderun module root:

go run ./examples/wait-notify

Expected output:

the parked message is free!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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