Documentation
¶
Overview ¶
Package engine provides a provider-neutral durable-delivery runtime core for actorlayer dispatch.
The engine contract is deliberately small. A product supplies a Source that yields deliveries, a Handler that executes one delivery, a Resolver that maps each delivery to a deterministic lane key, an optional EventSink for generic lifecycle events, and RetryPolicy hooks for retry classification, backoff, and exhaustion checks.
Engine events are generic execution facts: running, in_progress, acked, retrying, and deadlettered. The engine does not define product event subjects, queue names, task state transitions, DLQ storage, projection writes, provider selection, ADK sessions, Telegram delivery, MCP tools, model routing, or workspace policy. Products such as Balda own those decisions in their integration layer while using this package for deterministic lane execution and delivery settlement orchestration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrActorNotFound = actorlayer.ErrActorNotFound
Functions ¶
This section is empty.
Types ¶
type AddressResolver ¶
type Config ¶
type Config struct {
Resolver Resolver
Retry RetryPolicy
Sink EventSink
LaneIdleTTL time.Duration
}
type DispatchRuntime ¶
type DispatchRuntime struct {
// contains filtered or unexported fields
}
func NewDispatchRuntime ¶
func NewDispatchRuntime(cfg RuntimeConfig) (*DispatchRuntime, error)
func (*DispatchRuntime) Handle ¶
func (r *DispatchRuntime) Handle(ctx context.Context, delivery Delivery) error
func (*DispatchRuntime) LaneStatus ¶
func (r *DispatchRuntime) LaneStatus() LaneStatus
type LaneKeyResolver ¶
type LaneStatus ¶
type ResolveError ¶
type ResolveError struct {
Address string
}
ResolveError is returned when a dispatch address cannot be resolved. It wraps ErrActorNotFound to support errors.Is checks while preserving the concrete address in messages and logs.
func (*ResolveError) Error ¶
func (e *ResolveError) Error() string
func (*ResolveError) Unwrap ¶
func (e *ResolveError) Unwrap() error
type RetryPolicy ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) EmitInProgress ¶
func (*Runtime) LaneStatus ¶
func (r *Runtime) LaneStatus() LaneStatus
type RuntimeConfig ¶
type RuntimeConfig struct {
Registry dispatch.Registry
AddressOf AddressResolver
LaneKey LaneKeyResolver
Retry RetryPolicy
Sink EventSink
LaneIdleTTL time.Duration
}