signaler

package
v0.6.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signaler

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

Signaler sets up a signal catcing channel and allows background tasks to be canceled in unison

func Setup

func Setup() *Signaler

func (*Signaler) ManualShutdown

func (s *Signaler) ManualShutdown(timeout time.Duration) error

ManualShutdown triggers an artificial shutdown and then calls Wait with the given timeout

func (*Signaler) Start

func (s *Signaler) Start(task func(context.Context) error)

Start starts the given task on a goroutine using the global context

func (*Signaler) Wait

func (s *Signaler) Wait(timeout time.Duration) error

Wait blocks until all of the started tasks are completed and returns any errors that occur

Jump to

Keyboard shortcuts

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