block

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(opt *option)

func WithMaxSize

func WithMaxSize(max int) Option

type Queue

type Queue[T any] interface {
	// Enqueue 添加元素到队列
	// 如果队列已关闭,则返回 false,否则返回 true
	Enqueue(value T) bool

	// Dequeue 获取队列中的所有元素
	// 如果队列中没有元素,则本方法会一直阻塞,直到有元素
	// 如果队列已关闭,则返回 false,否则返回 true
	Dequeue(*[]T) bool

	// Close 关闭队列
	Close()

	// Closed 获取队列是否关闭
	Closed() bool
}

Queue 阻塞队列

func New

func New[T any](opts ...Option) Queue[T]

Jump to

Keyboard shortcuts

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