model

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 0 Imported by: 0 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

Index

Constants

View Source
const (
	TaskTypeImmediate = "immediate"
	TaskTypeCountdown = "countdown"
	TaskTypeScheduled = "scheduled"

	TaskStatusPending   = "pending"
	TaskStatusRunning   = "running"
	TaskStatusCompleted = "completed"
	TaskStatusFailed    = "failed"
	TaskStatusCancelled = "cancelled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaimedTask

type ClaimedTask struct {
	Task
	MessageSessionKey string
	MessagePlatform   string
}

ClaimedTask is a Task joined with data from its originating platform_messages row, needed by the TaskScheduler to build a DispatchTask.

type ExecutionStatus

type ExecutionStatus string
const (
	ExecStatusPending   ExecutionStatus = "pending"
	ExecStatusRunning   ExecutionStatus = "running"
	ExecStatusCompleted ExecutionStatus = "completed"
	ExecStatusFailed    ExecutionStatus = "failed"
)

type Task

type Task struct {
	ID          string
	MessageID   string
	WorkerID    string
	Instruction string
	Type        string // TaskTypeImmediate | TaskTypeCountdown | TaskTypeScheduled
	Status      string // TaskStatus*
	ScheduledAt *int64 // ms; countdown: absolute trigger time
	CronExpr    string
	NextRunAt   *int64 // ms; scheduled tasks only
	ExecutionID string
	CreatedAt   int64
	UpdatedAt   int64
}

Task represents a unit of work created by bee and dispatched to a worker.

type Worker

type Worker struct {
	ID          string       `json:"id" db:"id"`
	Name        string       `json:"name" db:"name"`
	Description string       `json:"description" db:"description"`
	Memory      string       `json:"memory" db:"memory"`
	WorkDir     string       `json:"work_dir" db:"work_dir"`
	Status      WorkerStatus `json:"status" db:"status"`
	CreatedAt   int64        `json:"created_at" db:"created_at"`
	UpdatedAt   int64        `json:"updated_at" db:"updated_at"`
}

type WorkerExecution

type WorkerExecution struct {
	ID           string          `json:"id" db:"id"`
	WorkerID     *string         `json:"worker_id,omitempty" db:"worker_id"`
	WorkerName   string          `json:"worker_name,omitempty" db:"-"`
	SessionID    string          `json:"session_id" db:"session_id"`
	TriggerInput string          `json:"trigger_input,omitempty" db:"trigger_input"`
	Status       ExecutionStatus `json:"status" db:"status"`
	Result       string          `json:"result,omitempty" db:"result"`
	LogPath      string          `json:"log_path,omitempty" db:"log_path"`
	AIProcessPID int             `json:"ai_process_pid,omitempty" db:"ai_process_pid"`
	StartedAt    *int64          `json:"started_at,omitempty" db:"started_at"`
	CompletedAt  *int64          `json:"completed_at,omitempty" db:"completed_at"`
}

type WorkerStatus

type WorkerStatus string
const (
	WorkerStatusIdle    WorkerStatus = "idle"
	WorkerStatusWorking WorkerStatus = "working"
	WorkerStatusError   WorkerStatus = "error"
)

Jump to

Keyboard shortcuts

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