examples

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package examples — workflow patterns that exercise the Hanzo Tasks engine end-to-end via the native ZAP SDK at pkg/sdk/client. Zero go.temporal.io/* and zero google.golang.org/grpc imports.

The samples run against an embedded tasksd boot (see _test.go) so they double as the integration test corpus for every shipped release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronResult

type CronResult struct {
	ScheduleID  string
	ListedCount int
	Paused      bool
	Resumed     bool
}

func Cron

func Cron(ctx context.Context, c client.Client, _ string) (*CronResult, error)

Cron creates a schedule, lists schedules, pauses + unpauses it, then deletes it.

type HelloResult

type HelloResult struct {
	StartedID    string
	StartedRunID string
	BeforeStatus int
	AfterStatus  int
	ListedCount  int
}

Hello starts a no-input workflow and confirms its execution record is round-trippable across the full client surface: ExecuteWorkflow → DescribeWorkflow → ListWorkflows → CancelWorkflow → DescribeWorkflow.

The returned Result captures the lifecycle so tests can assert on each transition without re-issuing the calls.

func Hello

func Hello(ctx context.Context, c client.Client, namespace string) (*HelloResult, error)

Hello drives the basic workflow lifecycle. It never blocks on workflow completion (the engine doesn't execute user code yet); it only verifies the control-plane round-trips end-to-end.

type SignalResult

type SignalResult struct {
	WorkflowID    string
	RunID         string
	HistoryBefore int64
	HistoryAfter  int64
	FinalStatus   int
}

SignalResult captures the lifecycle of a signal-driven workflow.

func Signal

func Signal(ctx context.Context, c client.Client, _ string) (*SignalResult, error)

Signal drives a workflow + a signal + a terminate. The engine doesn't run the workflow's signal channel goroutine yet, but the history length must increment on each signal.

Jump to

Keyboard shortcuts

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