pull

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	// LeaseTTL is how long a lease lasts without a renewal.
	LeaseTTL = 60 * time.Second
)

Variables

View Source
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 New

func New(store check.Store, runners []check.Runner, clock check.Clock) *Queue

New returns a queue for the pull runners in runners. A nil clock means the wall clock.

func (*Queue) Dispatch

func (q *Queue) Dispatch(_ context.Context, req runnerproto.Request) error

Dispatch queues req. The store holds the request already, so the queue only wakes the polls.

func (*Queue) Lease

Lease waits up to wait for a request of a repository that kid serves, and leases it. It returns false when none came.

func (*Queue) Renew

func (q *Queue) Renew(ctx context.Context, kid, leaseID string) (runnerproto.Renewal, error)

Renew extends the lease leaseID of kid by LeaseTTL from now. It refuses a kid that no pull repository registers any more.

Jump to

Keyboard shortcuts

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