execution

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 5 Imported by: 2 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor func(execCtx MessageExecutionCtx) error

Executor is a callback that will be called on received message with context. it should return an error only if internal server error happened, in case of business errors it's best to send a failure event.

type MessageExecutionCtx

type MessageExecutionCtx interface {
	// Message returns received message
	Message() *message.ReceivedMessage
	// Context returns parent execution context. Each message has own time limit in which it must be processed.
	Context() context.Context
	// Valid Deprecated
	Valid() bool
	// Send sends an out coming message to registered endpoints
	Send(message *message.OutcomingMessage, options ...endpoint.DeliveryOption) error
	// Return sends received message to registered endpoints and updates number of returns in headers
	Return(options ...endpoint.DeliveryOption) error
	// Logger returns logger instance with traceId and message uid included as fields
	Logger() log.Logger
}

MessageExecutionCtx is passed to each executor and contains received message, ctx, knows how to send out or return a message.

type MessageExecutionCtxFactory

type MessageExecutionCtxFactory interface {
	CreateCtx(ctx context.Context, message *message.ReceivedMessage) MessageExecutionCtx
}

func NewMessageExecutionCtxFactory

func NewMessageExecutionCtxFactory(router endpoint.Router, logger log.Logger) MessageExecutionCtxFactory

Jump to

Keyboard shortcuts

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