util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunnerWithContext

type RunnerWithContext interface {
	// Run blocks in processing until context sends a stop signal
	// because it has been interrupted externally. It can be cancelled
	// also by this function to broadcast stop to other parallel
	// routines.
	// Run should change accordingly the implementation running state
	// so that IsRunning can be used to query for it.
	Run(ctx context.Context, cancel context.CancelFunc) error
	// IsRunning returns the running state of this RunnerWithContext
	IsRunning() bool
}

RunnerWithContext defines API contract for implementors that start and block in processing until a stop signal is received from the context. A tipical use is in systems with multiple concurent runners that share context. Typical implementors would be servers and server-like programs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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