breaker

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package breaker provides OSSignals struct for OS signals handling (with context).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSSignals

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

OSSignals allows to subscribe for system signals.

func NewOSSignals

func NewOSSignals(ctx context.Context) OSSignals

NewOSSignals creates new subscriber for system signals.

func (*OSSignals) Stop

func (oss *OSSignals) Stop()

Stop system signals listening.

func (*OSSignals) Subscribe

func (oss *OSSignals) Subscribe(onSignal func(os.Signal), signals ...os.Signal)

Subscribe for some of system signals (call Stop for stopping).

Jump to

Keyboard shortcuts

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