fchan

package
v0.0.0-...-9cd8047 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoundedChan

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

BoundedChan is a thread_local handle onto a bounded channel.

func NewBounded

func NewBounded(bufsz uint64) *BoundedChan

NewBounded allocates a new queue and returns a handle to that queue. Further handles are created by calling NewHandle on the result of NewBounded.

func (*BoundedChan) Dequeue

func (b *BoundedChan) Dequeue() Elt

Dequeue receives an Elt from b. It blocks if there are no elements enqueued there.

func (*BoundedChan) Enqueue

func (b *BoundedChan) Enqueue(e Elt)

Enqueue sends e on b. If there are already >=bound goroutines blocking, then Enqueue will block until sufficiently many elements have been received.

func (*BoundedChan) NewHandle

func (b *BoundedChan) NewHandle() *BoundedChan

NewHandle creates a new handle for the given Queue.

type Elt

type Elt *interface{}

Elt is the element type of a queue, can be any pointer type

type UnboundedChan

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

Thread-local state for interacting with an unbounded channel

func New

func New() *UnboundedChan

New initializes a new queue and returns an initial handle to that queue. All other handles are allocated by calls to NewHandle()

func (*UnboundedChan) Dequeue

func (u *UnboundedChan) Dequeue() Elt

Dequeue an element from the channel, will block if nothing is there

func (*UnboundedChan) Enqueue

func (u *UnboundedChan) Enqueue(e Elt)

Enqueue enqueues a Elt into the channel TODO(ezrosent) enforce that e is not nil, I think we make that assumption here..

func (*UnboundedChan) NewHandle

func (u *UnboundedChan) NewHandle() *UnboundedChan

NewHandle creates a new handle for the given Queue.

Jump to

Keyboard shortcuts

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