Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultBranch = "gh-aw-work-queue"
View Source
const FileName = "work-queue.jsonl"
View Source
const MaxEnqueued int64 = 9007199254740991
MaxEnqueued is the largest integer represented exactly by JavaScript.
Variables ¶
This section is empty.
Functions ¶
func OldestAvailable ¶ added in v0.90.4
func OldestAvailable(transactions []Transaction) (string, error)
OldestAvailable selects by enqueue time, then UTF-8 Work identity. Legacy Work has age zero; an empty identity means no Work is available.
func Serialize ¶
func Serialize(transactions []Transaction) ([]byte, error)
Types ¶
type Branch ¶
Branch operates through GitHub Git APIs without a local checkout or Git executable.
func (Branch) Update ¶
func (b Branch) Update(ctx context.Context, change func([]Transaction) ([]Transaction, bool, error)) ([]Transaction, bool, error)
Update retries rejected non-force reference updates from a fresh branch snapshot.
type ClaimState ¶
type Projection ¶
type Projection struct {
Works []WorkState `json:"works"`
Available []string `json:"available"`
Stats Stats `json:"stats"`
}
func Replay ¶
func Replay(transactions []Transaction) (Projection, error)
type Transaction ¶
type Transaction struct {
Kind string `json:"kind"`
WorkID string `json:"work_id"`
Work json.RawMessage `json:"work,omitempty"`
ClaimID string `json:"claim_id,omitempty"`
RunID string `json:"run_id,omitempty"`
AttemptID string `json:"attempt_id,omitempty"`
Outcome string `json:"outcome,omitempty"`
Enqueued int64 `json:"enqueued,omitempty"`
}
func Apply ¶
func Apply(transactions []Transaction, tx Transaction) ([]Transaction, bool, error)
func Compact ¶
func Compact(transactions []Transaction) ([]Transaction, error)
func NewWork ¶ added in v0.90.4
func NewWork(payload []byte) (Transaction, error)
NewWork captures immutable enqueue time before publication retries.
func Parse ¶
func Parse(data []byte) ([]Transaction, error)
type WorkState ¶
type WorkState struct {
WorkID string `json:"work_id"`
Work json.RawMessage `json:"work"`
State string `json:"state"`
Winner string `json:"winner,omitempty"`
Claims []ClaimState `json:"claims"`
Outcome string `json:"outcome,omitempty"`
Enqueued int64 `json:"enqueued"`
}
Click to show internal directories.
Click to hide internal directories.