gchan

package
v0.0.0-...-3631402 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

优雅的Channel操作.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chan

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

func New

func New(limit int) *Chan

func (*Chan) Close

func (q *Chan) Close()

关闭队列(通知所有通过Pop阻塞的协程退出)

func (*Chan) Pop

func (q *Chan) Pop() interface{}

先进先出地从队列取出一项数据,当没有数据可获取时,阻塞等待

func (*Chan) Push

func (q *Chan) Push(v interface{}) error

将数据压入队列

func (*Chan) Size

func (q *Chan) Size() int

获取当前队列大小

Jump to

Keyboard shortcuts

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