container

package
v0.0.0-...-385f941 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncQueue

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

Synchronous FIFO queue

func NewSyncQueue

func NewSyncQueue() *SyncQueue

Create a new SyncQueue

func (*SyncQueue) Close

func (q *SyncQueue) Close()

Close SyncQueue

After close, Pop will return nil without block, and TryPop will return v=nil, ok=True

func (*SyncQueue) Len

func (q *SyncQueue) Len() (l int)

Get the length of SyncQueue

func (*SyncQueue) Pop

func (q *SyncQueue) Pop() (v interface{})

Pop an item from SyncQueue, will block if SyncQueue is empty

func (*SyncQueue) Push

func (q *SyncQueue) Push(v interface{})

Push an item to SyncQueue. Always returns immediately without blocking

func (*SyncQueue) TryPop

func (q *SyncQueue) TryPop() (v interface{}, ok bool)

Try to pop an item from SyncQueue, will return immediately with bool=false if SyncQueue is empty

Jump to

Keyboard shortcuts

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