group

package
v0.14.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(context.Context) error

Callback function that will be called on service starts.

type Option

type Option func(*group)

Option allows to change group settings.

func WithIgnoreErrors

func WithIgnoreErrors(v ...error) Option

WithIgnoreErrors allows to add ignored errors.

func WithShutdownTimeout

func WithShutdownTimeout(v time.Duration) Option

WithShutdownTimeout allows to change shutdown shutdown.

type Service

type Service interface {
	Add(Callback, Shutdown) Service
	Run(context.Context) error
}

Service collects services and runs them concurrently. - when any service returns, all services will be stopped. - when context canceled or deadlined all services will be stopped.

func New

func New(options ...Option) Service

New creates and configures Service by passed Option's.

type Shutdown

type Shutdown func(context.Context)

Shutdown function that receives shutdown context and allows to gracefully stop an service.

Jump to

Keyboard shortcuts

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