q

package module
v0.0.0-...-3b7a6fc Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 3 Imported by: 2

README

Q

a thread-safe (lock-free) queue for Go

GitHub Go Reference Go Report Card Go GitHub go.mod Go version (branch)

TODO

  • impl by generics

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Q

type Q item

Q is a thread-safe (lock-free) Queue

func (*Q) Peek

func (r *Q) Peek() (value interface{}, found bool)

Peek returns head item of queue without removing it. if no item found returns nil,false

func (*Q) Pull

func (r *Q) Pull() (value interface{}, found bool)

Pull returns head item of queue and remove it. if no item found returns nil,false

func (*Q) Push

func (r *Q) Push(value interface{})

Push add value to tail of queue

func (*Q) Reset

func (r *Q) Reset()

Reset skip all items in queue

func (*Q) Skip

func (r *Q) Skip() (found bool)

Skip removes head item of queue. returns false if no item found

Jump to

Keyboard shortcuts

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