Documentation ¶
Overview ¶
Package concurrent provides common functionality for dealing with concurrency that extends or enhances the core golang packages.
Deprecated: concurrent is no longer planned to be used by future WebPA/XMiDT services.
This package is frozen and no new functionality will be added.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Await ¶
Await uses Execute() to invoke a runnable, then waits for any traffic on a signal channel before shutting down gracefully.
Types ¶
type Runnable ¶
type Runnable interface { // Run executes this operation, possibly returning an error if the operation // could not be started. This method is responsible for spawning any necessary // goroutines and to ensure WaitGroup.Add() and WaitGroup.Done() are called appropriately. // Generally speaking, Run() should be idempotent. // // The supplied shutdown channel is used to signal any goroutines spawned by this // method that they should gracefully exit. Callers can then use the waitGroup to // wait until things have been cleaned up properly. Run(waitGroup *sync.WaitGroup, shutdown <-chan struct{}) error }
Runnable represents any operation that can spawn zero or more goroutines.
type RunnableFunc ¶
RunnableFunc is a function type that implements Runnable
type RunnableSet ¶
type RunnableSet []Runnable
RunnableSet is a slice type that allows grouping of operations. This type implements Runnable as well.
Click to show internal directories.
Click to hide internal directories.