shutdown

package module
v0.0.0-...-2d57b6d Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: BSD-2-Clause Imports: 2 Imported by: 3

README

Shutdown

Build Status

Build Status

Overview

Shutdown is a Go package which aims to help provide clean and deterministic behavior during application shutdown. Shutdown sync objects allow you to communicate the intent to shutdown, execute shutdown code, signal when shutdown is complete, and also provide for timeouts and error handling should shutdown procedures hang, deadlock, or do something unexpected.

License

This Go package is release under a BSD-style license, the contents of which are in the repo's LICENSE file.

API Documentation

http://godoc.org/github.com/xaevman/shutdown

Documentation

Index

Constants

View Source
const DefaultTimeoutSec = 30

Variables

This section is empty.

Functions

This section is empty.

Types

type Sync

type Sync struct {
	Signal chan interface{}
	// contains filtered or unexported fields
}

func New

func New() *Sync

func NewTimeout

func NewTimeout(timeoutSec int) *Sync

func (*Sync) Complete

func (s *Sync) Complete()

func (*Sync) IsShutdown

func (s *Sync) IsShutdown() bool

func (*Sync) Start

func (s *Sync) Start()

func (*Sync) WaitForTimeout

func (s *Sync) WaitForTimeout() bool

Jump to

Keyboard shortcuts

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