eventqueue

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package eventqueue provides an unboud FIFO queue of events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unbound

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

Unbound is an unbound FIFO queue of terminal events. Unbound must not be copied, pass it by reference only. This implementation is thread-safe.

func New

func New() *Unbound

New returns a new Unbound queue of terminal events. Call Close() when done with the queue.

func (*Unbound) Close

func (u *Unbound) Close()

Close should be called when the queue isn't needed anymore.

func (*Unbound) Empty added in v0.2.0

func (u *Unbound) Empty() bool

Empty determines if the queue is empty.

func (*Unbound) Pop

func (u *Unbound) Pop() terminalapi.Event

Pop pops an event from the queue. Returns nil if the queue is empty.

func (*Unbound) Pull

func (u *Unbound) Pull(ctx context.Context) (terminalapi.Event, error)

Pull is like Pop(), but blocks until an item is available or the context expires.

func (*Unbound) Push

func (u *Unbound) Push(e terminalapi.Event)

Push pushes an event onto the queue.

Jump to

Keyboard shortcuts

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