execqueue

package
v1.66.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: BSD-3-Clause Imports: 3 Imported by: 2

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) Wait

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

Wait waits for the queue to be empty.

Jump to

Keyboard shortcuts

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