Documentation
¶
Overview ¶
Package pull is the queue that runners poll. A runner dials out to ward, holds a lease on a request while it runs it, and renews the lease. A lease that is not renewed ends, and the same request is leasable again.
Index ¶
Constants ¶
const ( // LeaseTTL is how long a lease lasts without a renewal. LeaseTTL = 60 * time.Second )
Variables ¶
var ( // ErrUnknownRunner means that the kid is registered for no pull repository. ErrUnknownRunner = errors.New("pull: runner not registered") // ErrWeakIsolation means that the sandbox of the runner is weaker than every repository that it serves allows. ErrWeakIsolation = errors.New("pull: sandbox weaker than the minimum") // ErrLeaseLost means that the lease ended, was replaced, or its request is closed. ErrLeaseLost = errors.New("pull: lease lost") )
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is the queue of the pull repositories.
func (*Queue) Lease ¶
func (q *Queue) Lease(ctx context.Context, kid string, iso runnerproto.Isolation, wait time.Duration) (runnerproto.Lease, bool, error)
Lease waits up to wait for a request of a repository that kid serves, and leases it. It returns false when none came.