{"modulePath":"github.com/GoCodeAlone/workflow-plugin-eventbus","version":"v0.3.8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package steps\n\nPackage steps provides typed step handlers for the workflow-plugin-eventbus plugin: publish, consume, and ack operations dispatched through the providers.RuntimeBroker abstraction.\n\n## Variables\n\n```go\nvar AckFactory = sdk.NewTypedStepFactory(\n\t\"step.eventbus.ack\",\n\t\u0026emptypb.Empty{},\n\t\u0026eventbusv1.AckRequest{},\n\tAckHandler,\n)\n```\nAckFactory is the TypedStepProvider for step.eventbus.ack.\n\n```go\nvar ConsumeFactory = sdk.NewTypedStepFactory(\n\t\"step.eventbus.consume\",\n\t\u0026emptypb.Empty{},\n\t\u0026eventbusv1.ConsumeRequest{},\n\tConsumeHandler,\n)\n```\nConsumeFactory is the TypedStepProvider for step.eventbus.consume.\n\n```go\nvar PublishFactory = sdk.NewTypedStepFactory(\n\t\"step.eventbus.publish\",\n\t\u0026emptypb.Empty{},\n\t\u0026eventbusv1.PublishRequest{},\n\tPublishHandler,\n)\n```\nPublishFactory is the TypedStepProvider for step.eventbus.publish.\n\n## Functions\n\n```go\nfunc AckHandler(\n\tctx context.Context,\n\treq sdk.TypedStepRequest[*emptypb.Empty, *eventbusv1.AckRequest],\n) (*sdk.TypedStepResult[*eventbusv1.AckResponse], error)\n```\nAckHandler implements step.eventbus.ack. It dispatches the ack through the broker named by AckRequest.broker\\_ref via RuntimeBroker.Ack on the registered runtime/connection pair.\n\nLegacy fallback: when broker\\_ref is empty AND exactly one broker module is registered, that broker is used automatically (see LookupRuntimeWithFallback).\n\n```go\nfunc All() []sdk.TypedStepProvider\n```\nAll returns all step TypedStepProvider factories exported by this package. Register each with the plugin's sdk.Server via WithTypedStepProvider.\n\n```go\nfunc ConsumeHandler(\n\tctx context.Context,\n\treq sdk.TypedStepRequest[*emptypb.Empty, *eventbusv1.ConsumeRequest],\n) (*sdk.TypedStepResult[*eventbusv1.ConsumeResponse], error)\n```\nConsumeHandler implements step.eventbus.consume. It resolves the durable consumer's stream name from the in-process registry (populated by the eventbus.consumer module on Init), then dispatches the bounded-batch fetch through the broker named by ConsumeRequest.broker\\_ref via RuntimeBroker.Consume.\n\nReturned messages include ack\\_token, which the caller passes to step.eventbus.ack to acknowledge each message individually.\n\nLegacy fallback: when broker\\_ref is empty AND exactly one broker module is registered, that broker is used automatically (see LookupRuntimeWithFallback).\n\n```go\nfunc PublishHandler(\n\tctx context.Context,\n\treq sdk.TypedStepRequest[*emptypb.Empty, *eventbusv1.PublishRequest],\n) (*sdk.TypedStepResult[*eventbusv1.PublishResponse], error)\n```\nPublishHandler implements step.eventbus.publish. It dispatches the publish through the broker named by PublishRequest.broker\\_ref via LookupRuntime, then calls RuntimeBroker.Publish on the registered runtime/connection pair.\n\nLegacy fallback: when broker\\_ref is empty AND exactly one broker module is registered, that broker is used automatically. The fallback exists so configs predating the broker\\_ref proto field continue to work in single-bus deployments; multi-bus workflows must set broker\\_ref explicitly.\n\nThe step config is empty (no per-step config required). All parameters are supplied via the typed input message.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-eventbus/steps","name":"steps","synopsis":"Package steps provides typed step handlers for the workflow-plugin-eventbus plugin: publish, consume, and ack operations dispatched through the providers.RuntimeBroker abstraction.","isRedistributable":true}
