alt/services/worker/internal/jobs/job.go
toki f762d2abd9 feat: worker persistence layer and socket session updates
- Add worker storage layer with PostgreSQL/sqlc setup
- Add migration files for worker backbone schema
- Add job runner and built-in jobs implementation
- Add Redis key definitions for worker state management
- Archive socket-session-loop milestone (completed/renamed)
- Update roadmap current.md and foundation-alignment phase
- Add socket endpoint integration and runtime smoke tests
- Add infra-check, worker-storage-check, worker-storage-gen CLI tools
- Update API socket server and config
- Add pubspec dependencies and client socket endpoint changes
- Add config tests for API and worker services
2026-05-28 19:05:10 +09:00

31 lines
764 B
Go

package jobs
import "encoding/json"
// Kind represents the type of worker job.
type Kind string
const (
KindImportDailyBars Kind = "import_daily_bars"
KindNormalizeDailyBars Kind = "normalize_daily_bars"
KindRunBacktest Kind = "run_backtest"
)
// Status represents the state of a job.
type Status string
const (
StatusPending Status = "pending"
StatusRunning Status = "running"
StatusCompleted Status = "completed"
StatusFailed Status = "failed"
)
// Job represents a background execution unit.
type Job struct {
ID string `json:"id"`
Kind Kind `json:"kind"`
Status Status `json:"status"`
Payload json.RawMessage `json:"payload,omitempty"`
Error string `json:"error,omitempty"`
}