tasks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tasks provides a workflow SDK for defining and executing tasks in a workflow system.

This package allows you to register task functions and start a task execution server. Tasks are functions that accept a TaskContext as their first parameter, followed by any number of additional parameters.

Example usage:

func myTask(ctx tasks.TaskContext, input string) string {
	return "processed: " + input
}

func main() {
	err := tasks.RegisterTask(myTask)
	if err != nil {
		panic(err)
	}
	tasks.Start()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRegister

func MustRegister(task task.Task)

func Register

func Register(ctx context.Context, unixSocketPath string) error

func RegisterTask

func RegisterTask(task task.Task) error

func RegisterTaskWithOptions

func RegisterTaskWithOptions(t task.Task, options *Options) error

RegisterTaskWithOptions registers a task with configuration options

func Run

func Run(ctx context.Context, unixSocketPath string) (_err error)

func Start

func Start() error

Types

type Config

type Config struct {
	Mode       string `split_words:"true" required:"true"`
	SocketPath string `split_words:"true" required:"true"`
}

type Options

type Options = task.Options

type Retry

type Retry = task.Retry

type TaskContext

type TaskContext = task.TaskContext

Jump to

Keyboard shortcuts

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