exutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package exutil holds the few lines every example repeats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, c *packtrail.Client, flow string, input any) *packtrail.State

Run starts flow and waits for the final state.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group runs an engine and workers and stops them together: Stop cancels them and waits until they drained, so the connection can be closed after.

func NewGroup

func NewGroup(ctx context.Context) *Group

NewGroup returns a group whose members run until Stop (or ctx ends).

func (*Group) Engine

func (g *Group) Engine(nc *nats.Conn, opts ...packtrail.Option) *packtrail.Engine

Engine creates and runs an engine, and returns once it is ready: the namespace is provisioned and its consumers (cron and triggers included) are pulling.

func (*Group) Serve

func (g *Group) Serve(nc *nats.Conn, ns, kind string, h worker.Handler, opts ...worker.Option)

Serve runs a worker for kind.

func (*Group) Stop

func (g *Group) Stop()

Stop cancels every member and waits for them.

Jump to

Keyboard shortcuts

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