channels

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelTimeout

type ChannelTimeout interface {
	// Receive returns an object from the channel or an error if the timeout expires.
	// if timeout is zero then the receive block until an object is available.
	Receive(timeout time.Duration) (interface{}, error)

	// Send adds the given object into the channel or returns an error if the timeout expires.
	// if timeout is zero then the send block until the object is added.
	Send(obj interface{}, timeout time.Duration) error

	// Close the channel
	Close() error

	// Channel returns the underlying channel
	Channel() chan interface{}
}

ChannelTimeout represents a go channel with timeout

func NewChannelTimeout

func NewChannelTimeout(capacity int) ChannelTimeout

NewChannelTimeout creates a channel with timeout

Jump to

Keyboard shortcuts

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