eventqueue

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

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 simple struct that manages a queue of functions. Thread safe

func New

func New() *Queue

New returns a new instance of Queue

func (*Queue) Add

func (q *Queue) Add(f func())

Add will add an an item to the queue, thread safe.

func (*Queue) ClearAndStop

func (q *Queue) ClearAndStop()

ClearAndStop will clear the queue disable adding more items to it, thread safe.

func (*Queue) Pop

func (q *Queue) Pop() func()

Pop will return and delete an an item from the queue, thread safe.

Jump to

Keyboard shortcuts

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