Documentation ¶
Index ¶
- type Graceful
- func (g *Graceful) RegisterProcess(process func() error)
- func (g *Graceful) RegisterShutdownProcess(process func(context.Context) error)
- func (g *Graceful) RegisterShutdownProcessWithTag(process func(context.Context) error, tag string)
- func (g *Graceful) SetCancelOnError(value bool)
- func (g *Graceful) SetMaxShutdownProcess(max int)
- func (g *Graceful) SetMaxShutdownTime(duration time.Duration)
- func (g *Graceful) Wait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graceful ¶
type Graceful struct {
// contains filtered or unexported fields
}
Graceful struct to hold the provided options and dependencies
func NewContext ¶
NewContext initiate graceful with context param. create signal waiting from os signal that will be triggered when some signal is called.
func (*Graceful) RegisterProcess ¶
RegisterProcess register running process to background.
func (*Graceful) RegisterShutdownProcess ¶
RegisterShutdownProcess register shutdown process that will be called when got some os signal.
func (*Graceful) RegisterShutdownProcessWithTag ¶
RegisterShutdownProcessWithTag register shutdown process using tag.
func (*Graceful) SetCancelOnError ¶
SetCancelOnError set cancel on error value.
func (*Graceful) SetMaxShutdownProcess ¶
SetMaxShutdownProcess set max shutdown process value.
func (*Graceful) SetMaxShutdownTime ¶
SetMaxShutdownTime set max shutdown time value.
Click to show internal directories.
Click to hide internal directories.