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 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址