steps

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package steps provides typed step handlers for the workflow-plugin-eventbus plugin: publish, consume, and ack operations over NATS JetStream.

Index

Constants

This section is empty.

Variables

View Source
var AckFactory = sdk.NewTypedStepFactory(
	"step.eventbus.ack",
	&emptypb.Empty{},
	&eventbusv1.AckRequest{},
	AckHandler,
)

AckFactory is the TypedStepProvider for step.eventbus.ack.

View Source
var ConsumeFactory = sdk.NewTypedStepFactory(
	"step.eventbus.consume",
	&emptypb.Empty{},
	&eventbusv1.ConsumeRequest{},
	ConsumeHandler,
)

ConsumeFactory is the TypedStepProvider for step.eventbus.consume.

View Source
var PublishFactory = sdk.NewTypedStepFactory(
	"step.eventbus.publish",
	&emptypb.Empty{},
	&eventbusv1.PublishRequest{},
	PublishHandler,
)

PublishFactory is the TypedStepProvider for step.eventbus.publish.

Functions

func AckHandler

AckHandler implements step.eventbus.ack. It publishes an empty message to the JetStream reply subject (ack_token) supplied by step.eventbus.consume, which causes the broker to mark the message as acknowledged.

func All

func All() []sdk.TypedStepProvider

All returns all step TypedStepProvider factories exported by this package. Register each with the plugin's sdk.Server via WithTypedStepProvider.

func ConsumeHandler

ConsumeHandler implements step.eventbus.consume. It binds to an existing JetStream durable consumer (looked up by the durable name in ConsumeRequest.consumer) and fetches up to batch_size messages, waiting at most max_wait for the batch to fill.

Returned messages include ack_token = msg.Reply, which the caller passes to step.eventbus.ack to acknowledge each message individually.

func PublishHandler

PublishHandler implements step.eventbus.publish. It publishes a single message to the NATS JetStream subject specified in PublishRequest.subject and returns the broker-assigned sequence number and acknowledgement timestamp.

The step config is empty (no per-step config required). All parameters are supplied via the typed input message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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