startstop

package
v0.0.0-...-bde87b4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartBlocking

func StartBlocking(ctx context.Context, starter Starter, sg ...os.Signal) error

StartBlocking starts the given Starter and blocks the goroutine until SIGTERM signal is received.

An optional signal can be provided to override the default SIGTERM signal.

Types

type Registry

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

func (*Registry) Start

func (r *Registry) Start(ctx context.Context) error

func (*Registry) Stop

func (r *Registry) Stop(ctx context.Context) error

type Starter

type Starter interface {
	// Start typically launches a cancellable blocking operation.
	Start(context.Context) error
	Stop(context.Context) error
}

Jump to

Keyboard shortcuts

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