Documentation
¶
Overview ¶
Package toolsched holds the daemon-wide scheduling primitives of native runs: a semaphore for model requests and keyed locks and batches for tool calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPanicked = errors.New("tool call panicked")
ErrPanicked reports a call that panicked; the batch goes on.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch[T any] struct { // contains filtered or unexported fields }
Batch runs the calls of one model reply concurrently: calls sharing a key run one at a time in the order they were started, each holding its key in Locks, and at most limit calls run at once. Only the goroutine that created the batch may call its methods; Next reports every started call exactly once.
type Done ¶
Done is a finished call: Value is what it returned, or Err says why it did not run (its context stopped) or did not return (ErrPanicked).
type Locks ¶
type Locks struct {
// contains filtered or unexported fields
}
Locks is a keyed mutex shared by every run of the daemon: holders of one key run one at a time; the empty key is never locked.
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore lets at most n holders in at once; a nil Semaphore never blocks.
func NewSemaphore ¶
NewSemaphore returns a semaphore with n slots, or nil when n <= 0.