queue

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package queue is the line of up --wait processes waiting for memory. It has no service: each waiting process keeps one file under ~/.siding/queue, and every process reads the directory to learn its place. The order is the order of arrival; a process that ended leaves the line, also when it was killed, because a file whose process is gone counts as gone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Place

func Place(line []Entry, pid int) int

Place is the 1-based place of the process pid in line, or 0 when it is not in it.

Types

type Entry

type Entry struct {
	Project  string    `json:"project"`
	PID      int       `json:"pid"`
	Estimate int64     `json:"estimate"`
	Since    time.Time `json:"since"`
	// contains filtered or unexported fields
}

Entry is one waiting up.

type Line

type Line struct {
	// contains filtered or unexported fields
}

Line is the queue directory of one machine.

func Open

func Open(home string, alive func(pid int) bool) Line

Open returns the line under home; alive tells whether a process still runs.

func (Line) Enter

func (l Line) Enter(e Entry) (leave func(), err error)

Enter puts a process at the end of the line and returns the function that takes it out.

func (Line) List

func (l Line) List() ([]Entry, error)

List returns the line in order of arrival. It removes the files of processes that are gone.

Jump to

Keyboard shortcuts

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