workers

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

README

Workers

The core/workers package is used to setup gracefully terminating workers for services.

Examples

The worker interfaces

All workers implement a simple interface for running and halting, using the context package for timeouts.

// Runner represents the behaviour for running a service worker.
type Runner interface {
	// Run should run start processing the worker and be a blocking operation.
	Run(context.Context) error
}

// Halter represents the behaviour for stopping a service worker.
type Halter interface {
	// Halt should tell the worker to stop doing work.
	Halt(context.Context) error
}

// Worker represents the behaviour for a service worker.
type Worker interface {
	Runner
	Halter
}

Documentation

Overview

Package workers is used to setup gracefully terminating workers for services.

Directories

Path Synopsis
Package grpcsrv provides a default set of configuration for hosting a grpc server in a service.
Package grpcsrv provides a default set of configuration for hosting a grpc server in a service.
Package httpsrv provides a default set of configuration for hosting a http server in a service.
Package httpsrv provides a default set of configuration for hosting a http server in a service.
Package keybroker implements a background broker conmtinous retrieval of public keys from multiple different type of sources.
Package keybroker implements a background broker conmtinous retrieval of public keys from multiple different type of sources.
keybrokermock
Package keybrokermock implements no-op mocks for the keys package
Package keybrokermock implements no-op mocks for the keys package
Package metricsrv provides a default set of configuration for hosting http prometheus metrics in a service.
Package metricsrv provides a default set of configuration for hosting http prometheus metrics in a service.
Package readysrv is used to provide readiness checks for a service.
Package readysrv is used to provide readiness checks for a service.

Jump to

Keyboard shortcuts

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