queue

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package queue runs tasks one at a time, in the order they were added, like the p-queue (concurrency 1) instances @orbitdb/core uses to serialise sync messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue is a FIFO of tasks run by a single worker goroutine. Adding never blocks.

func New

func New() *Queue

New starts a queue.

func (*Queue) Add

func (q *Queue) Add(task func()) bool

Add queues task. It reports false if the queue is closed.

func (*Queue) Close

func (q *Queue) Close()

Close drops pending tasks and waits for the running one, if any.

Jump to

Keyboard shortcuts

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