grawt

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 5 Imported by: 1

README

grawt

graceful terminations for go applications

example usage

var waiter = grawt.NewWaiter()

waiter.AddCloseHandler(func() {
		nacl.FinalizeStan()
	}, false)

waiter.Wait(true)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseHandler

type CloseHandler struct {
	Quit chan bool
	// contains filtered or unexported fields
}

func (*CloseHandler) Done

func (ch *CloseHandler) Done()

func (*CloseHandler) Halt

func (ch *CloseHandler) Halt(err error)

type Waiter

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

func NewWaiter

func NewWaiter() *Waiter

func (*Waiter) AddCloseHandler

func (w *Waiter) AddCloseHandler(f func(), waitForChannel bool) *CloseHandler

func (*Waiter) Halt

func (w *Waiter) Halt(err error)

func (*Waiter) Wait

func (w *Waiter) Wait(blockingMode bool)

Jump to

Keyboard shortcuts

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