assignment

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package assignment implements lease-based work claims for agent sessions.

Index

Constants

View Source
const (
	StatusActive    = "active"
	StatusReleased  = "released"
	StatusExpired   = "expired"
	StatusCompleted = "completed"
)
View Source
const DefaultLease = 4 * time.Hour

DefaultLease is the default lease duration when none is specified.

Variables

This section is empty.

Functions

func Claim

func Claim(rmiID, worker string, lease time.Duration, now time.Time, existing *store.Assignment) (*store.Assignment, error)

Claim creates an assignment for the given RMI and worker. It returns an error if the RMI already has an active, non-expired assignment.

func Complete

func Complete(a *store.Assignment, now time.Time) error

Complete marks an active assignment as completed.

func ExpireStale

func ExpireStale(a *store.Assignment, now time.Time) bool

ExpireStale transitions any active assignment whose lease has passed to expired.

func Release

func Release(a *store.Assignment, now time.Time) error

Release marks an active assignment as released.

func Renew

func Renew(a *store.Assignment, lease time.Duration, now time.Time) error

Renew extends an active assignment's lease. Returns an error if the assignment is not active.

func TrailerLine

func TrailerLine(rmiID string) string

TrailerLine returns the git trailer string for a claimed RMI.

Types

This section is empty.

Jump to

Keyboard shortcuts

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