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 ¶
- func MustRegister(task task.Task)
- func Register(ctx context.Context, unixSocketPath string) error
- func RegisterTask(task task.Task) error
- func RegisterTaskWithOptions(t task.Task, options *Options) error
- func Run(ctx context.Context, unixSocketPath string) (_err error)
- func Start() error
- type Config
- type Options
- type Retry
- type TaskContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegister ¶
func RegisterTask ¶
func RegisterTaskWithOptions ¶
RegisterTaskWithOptions registers a task with configuration options
Types ¶
type TaskContext ¶
type TaskContext = task.TaskContext
Click to show internal directories.
Click to hide internal directories.