execqueue

package
v1.104.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 2 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 execqueue implements an ordered asynchronous queue for executing functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecQueue

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

func (*ExecQueue) Add

func (q *ExecQueue) Add(f func())

func (*ExecQueue) RunSync

func (q *ExecQueue) RunSync(ctx context.Context, f func()) error

RunSync waits for the queue to be drained and then synchronously runs f. It returns an error if the queue is closed before f is run or ctx expires.

func (*ExecQueue) Shutdown

func (q *ExecQueue) Shutdown()

Shutdown asynchronously signals the queue to stop.

func (*ExecQueue) ShutdownAndWait added in v1.102.0

func (q *ExecQueue) ShutdownAndWait(ctx context.Context) error

ShutdownAndWait signals the queue to stop, discards any queued functions that have not started, and waits for the currently executing function, if any, to complete or ctx to expire.

It must not be called while holding a lock that a queued function may acquire, or it will not return until ctx expires.

func (*ExecQueue) Wait

func (q *ExecQueue) Wait(ctx context.Context) error

Wait waits for the queue to be empty or shut down.

Jump to

Keyboard shortcuts

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