Documentation
¶
Overview ¶
Package pull dispatches a check request through a 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
- Variables
- type Queue
- func (q *Queue) Dispatch(_ context.Context, req runnerproto.Request) error
- func (q *Queue) Lease(ctx context.Context, kid string, iso runnerproto.Isolation, wait time.Duration) (runnerproto.Lease, bool, error)
- func (q *Queue) Renew(ctx context.Context, kid, leaseID string) (runnerproto.Renewal, error)
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) Dispatch ¶
Dispatch queues req. The store holds the request already, so the queue only wakes the polls.