Documentation
¶
Overview ¶
Package renderbatch implements per-device manager batching, not panel cadence. It holds revision handles only; the owner retains immutable complete targets.
Index ¶
- Variables
- type Policy
- type Queue
- func (q *Queue) Release(revision Revision) error
- func (q *Queue) Submit(revision Revision, now time.Duration) error
- func (q *Queue) SubmitUrgent(revision Revision, now time.Duration) error
- func (q *Queue) Take(now time.Duration, available bool) (Revision, error)
- func (q *Queue) Wait(now time.Duration) (time.Duration, bool, error)
- type Revision
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Policy ¶
Policy uses zero for omitted settings. MaxWait alone never introduces delay. Parse external durations with checked conversion; do not cast float seconds.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is single-owner. Serialize API edits before Submit, so a new revision represents the whole canonical scene, not an independently rendered patch. No goroutines, timers, frame copies, or unbounded history are owned here.
func (*Queue) Release ¶
Release ends exactly the matching lease, without claiming display success or retrying it. The owner must reconcile failures/unknown ACKs before availability becomes true again. Confirmed frame/revision is deliberately not tracked here.
func (*Queue) Submit ¶
Submit replaces only pending work. Revisions never wrap within this queue; start a new coordinator epoch before exhaustion. Stale renders cannot submit.
func (*Queue) SubmitUrgent ¶
SubmitUrgent bypasses grouping for this replacement only. It cannot bypass availability or the existing flight lease, and does not authorize refresh.
func (*Queue) Take ¶
Take leases the newest ready revision. Availability includes transport, renderer readiness and device safety. MaxWait never overrides these gates. Zero means nothing can dispatch. New arrivals start a separate pending window.
func (*Queue) Wait ¶
Wait returns the remaining grouping delay. False means no pending work. Caller can use a single timer and wake it on Submit, availability or Release. Elapsed-time subtraction avoids overflow when durations approach MaxInt64. Supply time.Since(serverStart), not Unix time, to preserve monotonic behavior: https://pkg.go.dev/time#hdr-Monotonic_Clocks