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 EmbedResult ¶ added in v1.41.0
type EmbedResult struct {
Port int
HealthService string
HealthStatus string
StartedID string
StartedRunID string
ListedCount int
}
EmbedResult captures the lifecycle of an in-process daemon dial.
func Embed ¶ added in v1.41.0
func Embed(ctx context.Context) (*EmbedResult, error)
Embed boots tasks.Embed in-process on an ephemeral port, dials it via pkg/sdk/client, and round-trips Health → ExecuteWorkflow → ListWorkflows. This is the canonical "single binary" pattern Base apps use when TASKS_EMBED=true; the sample exercises the same code path so a regression in either the Embed boot or the SDK dial would trip the test suite immediately.
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.
type RealtimeResult ¶ added in v1.41.0
RealtimeResult captures what arrived on the SSE stream during the demo window: every workflow.* event for the workflows we started.
func Realtime ¶ added in v1.41.0
func Realtime(parent context.Context) (*RealtimeResult, error)
Realtime boots an embedded daemon, opens an SSE subscription via the native pkg/sdk/client.SubscribeEvents helper, fires a few state-changing operations, and tallies the events it observed before the context expires.
This proves the realtime pipeline end-to-end: engine → broker → SSE → SDK channel → caller. No proxy, no gRPC, no upstream client.