channel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsSync

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

ConsSync is a synchronization handle owned by consumers that is used to shutdown goroutine producers.

func NewConsSync

func NewConsSync() *ConsSync

NewConsSync returns an initialized consumer shutdown handle.

func (*ConsSync) Add

func (cons *ConsSync) Add(delta int)

Add producers to wait for when shutting down.

func (*ConsSync) ProdSync

func (cons *ConsSync) ProdSync() ProdSync

ProdSync returns a handle used by producers to honor the shutdown synchronization contract.

func (*ConsSync) Shutdown

func (cons *ConsSync) Shutdown() (wait func())

Shutdown shuts down goroutine producers. It returns a synchronization function that can be executed by the caller if shutdown was initiated for the first time.

type ProdSync

type ProdSync struct {
	SignalChan <-chan struct{} // Channel that will be closed to signal that shutdown should be performed.
	// contains filtered or unexported fields
}

ProdSync is a synchronization handle used by producers to be notified when to perform shutdown and to signal that shutdown has been performed.

func (*ProdSync) Done

func (prod *ProdSync) Done()

Done signals that the producer has completed shutdown.

Jump to

Keyboard shortcuts

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