unchan

package module
v0.0.0-...-237187e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

README

DOI

unchan

unchan is the unordered channel. Although typical desire when using a Go channel is to maintain order, there are some instances when that order is not the goal.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unchan

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

Unchan is an unordered channel. Values that are sent are received in any order.

func New

func New(l int) *Unchan

New generates a new unordered channel of given length/capacity.

func (*Unchan) Cap

func (c *Unchan) Cap() int

Cap is the maximum number of values the channel can hold.

func (*Unchan) Len

func (c *Unchan) Len() int

Len is the current number of values in the channel.

func (*Unchan) Receive

func (c *Unchan) Receive() interface{}

Receive pulls a value out of the channel.

func (*Unchan) Send

func (c *Unchan) Send(v interface{})

Send pushes a value down the channel.

Jump to

Keyboard shortcuts

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