interrupt

package module
v0.0.0-...-8921ac2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: MIT Imports: 3 Imported by: 0

README

interrupt

godoc goreportcard

Install

go get -u github.com/117/interrupt

Usage

The Await method lets you delay exit until the process is interrupted.

package main

import "github.com/117/interrupt"

func main() {
  // your goroutines and code here
  interrupt.Await() // block until you ctrl + c
  fmt.Println("caught interrupt, exiting safely")
  // do your cleanup here
}
Contribute

Pull requests are encouraged.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Await

func Await()

Await - Block until the process is interrupted by a SIGTERM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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