Documentation
¶
Overview ¶
Package jobqueue provides a standalone job queue. Jobs are enqueued via CLI and executed as workflows. The plugin adds a task_queue table, HTTP endpoints for job CRUD, a CLI enqueue command, and a background worker that polls for pending jobs and logs dispatch events (actual workflow dispatch comes later).
Index ¶
- func New() plugin.Plugin
- type JobResponse
- type Plugin
- func (p *Plugin) Info() plugin.PluginInfo
- func (p *Plugin) Init(ctx context.Context, env *plugin.Environment) error
- func (p *Plugin) Migrations() []plugin.Migration
- func (p *Plugin) RegisterCommands() []plugin.Command
- func (p *Plugin) RegisterRoutes(mux *http.ServeMux) error
- func (p *Plugin) Run(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JobResponse ¶
type JobResponse struct {
JobID uuid.UUID `json:"job_id"`
QueueName string `json:"queue_name"`
Status string `json:"status"`
Payload json.RawMessage `json:"payload"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
}
JobResponse is the JSON shape returned for a single job.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements a standalone job queue with tenant isolation.
func (*Plugin) Info ¶
func (p *Plugin) Info() plugin.PluginInfo
Info returns plugin metadata for discovery and documentation.
func (*Plugin) Migrations ¶
Migrations returns the database schema for the job queue. Tables are idempotent (IF NOT EXISTS) and safe to run multiple times.
func (*Plugin) RegisterCommands ¶
RegisterCommands returns CLI subcommands for the job queue.
func (*Plugin) RegisterRoutes ¶
RegisterRoutes registers the job queue HTTP handlers on the given mux.