workflow_executor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package worker implements async job queue for skill execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID      string
	Type    string
	Payload map[string]interface{}
}

Job represents an async work item.

type JobHandler

type JobHandler func(ctx context.Context, job Job) error

JobHandler processes a job.

type JobQueue

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

JobQueue manages async job processing.

func NewJobQueue

func NewJobQueue(workers int) *JobQueue

NewJobQueue creates a new queue with specified worker count.

func (*JobQueue) SetHandler

func (q *JobQueue) SetHandler(h JobHandler)

SetHandler sets the job processing function.

func (*JobQueue) Status

func (q *JobQueue) Status() QueueStatus

Status returns current queue status.

func (*JobQueue) Stop

func (q *JobQueue) Stop() error

Stop gracefully shuts down the queue.

func (*JobQueue) Submit

func (q *JobQueue) Submit(ctx context.Context, job Job) error

Submit adds a job to the queue.

type QueueStatus

type QueueStatus struct {
	Workers   int
	Pending   int
	Processed int64
}

QueueStatus contains queue statistics.

Jump to

Keyboard shortcuts

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