executor

package
v0.0.0-...-eed91f4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 2 Imported by: 0

README

executor

import "go.bonk.build/pkg/executor"

Package executor provides the Executor interface, which is an abstraction for "object which may execute a task."

Subpackages provide useful executors for building task-executing heirarchies. Each package exports just a few objects conforming to the Executor interface, and optionally a few helpers.

Index

type Executor

Executor is the interface required to execute tasks.

type Executor interface {
    // Execute is given a task to execute and expected to populate result with the outcome.
    Execute(ctx context.Context, session task.Session, tsk *task.Task, result *task.Result) error
    // OpenSession is called before any tasks are executed, and can be used to do things such as
    // initializing caches, etc.
    OpenSession(ctx context.Context, session task.Session) error
    // CloseSession shuts down and frees all resources created over the course of a session.
    // After this call, no outstanding goroutines should be running.
    CloseSession(ctx context.Context, sessionID task.SessionID)
}

type NoopSessionManager

NoopSessionManager can be embedded if session management isn't necessary.

type NoopSessionManager struct{}

func (NoopSessionManager) CloseSession
func (n NoopSessionManager) CloseSession(context.Context, task.SessionID)

CloseSession implements Executor.

func (NoopSessionManager) OpenSession
func (n NoopSessionManager) OpenSession(context.Context, task.Session) error

OpenSession implements Executor.

Generated by gomarkdoc

Documentation

Overview

Package executor provides the Executor interface, which is an abstraction for "object which may execute a task."

Subpackages provide useful executors for building task-executing heirarchies. Each package exports just a few objects conforming to the Executor interface, and optionally a few helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Execute is given a task to execute and expected to populate result with the outcome.
	Execute(ctx context.Context, session task.Session, tsk *task.Task, result *task.Result) error
	// OpenSession is called before any tasks are executed, and can be used to do things such as
	// initializing caches, etc.
	OpenSession(ctx context.Context, session task.Session) error
	// CloseSession shuts down and frees all resources created over the course of a session.
	// After this call, no outstanding goroutines should be running.
	CloseSession(ctx context.Context, sessionID task.SessionID)
}

Executor is the interface required to execute tasks.

type NoopSessionManager

type NoopSessionManager struct{}

NoopSessionManager can be embedded if session management isn't necessary.

func (NoopSessionManager) CloseSession

func (n NoopSessionManager) CloseSession(context.Context, task.SessionID)

CloseSession implements Executor.

func (NoopSessionManager) OpenSession

OpenSession implements Executor.

Directories

Path Synopsis
Package argconv provides an executor for automatically unboxing task parameters.
Package argconv provides an executor for automatically unboxing task parameters.
Package observable provides an executor which alerts followers to task status
Package observable provides an executor which alerts followers to task status
Package plugin provides an executor which uses go-plugin to launch gRPC subprocesses.
Package plugin provides an executor which uses go-plugin to launch gRPC subprocesses.
Package router provides Router, which is meant to route tasks to child executors.
Package router provides Router, which is meant to route tasks to child executors.
Package scheduler provides an executor which executes followup tasks and resolves dependencies.
Package scheduler provides an executor which executes followup tasks and resolves dependencies.
Package statecheck provides an executor that avoids re-running tasks if they are already up to date.
Package statecheck provides an executor that avoids re-running tasks if they are already up to date.

Jump to

Keyboard shortcuts

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