embedded

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 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

Overview

Package embedded executes one immutable source bundle in-process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Namespace      string
	IdempotencyKey string
	Facts          map[string]any
	WaitMode       runtime.WaitMode
}

Request identifies one logical operation. Keep Namespace and IdempotencyKey stable for retries. Facts must remain unchanged while Execute reads them. An empty WaitMode uses terminal waiting.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime owns one immutable generation and an Engine. Embedded execution is intentionally descriptor-based; Go callback executors are not supported.

func Open added in v0.4.0

func Open(ctx context.Context, source *bundle.SourceBundle, resolvers *invocation.Registry) (*Runtime, error)

Open compiles and resolves a source bundle once. Executable identity comes from the bundle. The runtime owns resources returned by resolvers, not the registry's resolver implementations. Its default ledger and outbox are in memory. It does not start a recovery worker.

func (*Runtime) Close

func (r *Runtime) Close() error

Close drains entered calls and releases the owned engine and generation. Stop new callers first. Do not call Close from an executor using this runtime.

func (*Runtime) Engine added in v0.4.0

func (r *Runtime) Engine() *runtime.Engine

Engine returns the borrowed engine. Configure it before the first execution. The runtime retains ownership. Use Runtime.Close to end its lifetime.

func (*Runtime) Execute

func (r *Runtime) Execute(ctx context.Context, request Request) (runtime.ExecuteResult, error)

Execute uses the runtime's active generation and a non-nil context. It permits concurrent calls. Accepted-only results do not imply business completion. Terminal failures remain visible on replay through runtime.TerminalExecutionError.

Jump to

Keyboard shortcuts

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