git-bug: Index | Files

package interrupt

import ""


Package Files


type CancelFunc Uses

type CancelFunc func()

CancelFunc, if called, will disable the associated cleaner. This allow to create temporary cleaner. Be mindful though to not create too much of them as they are just disabled, not removed from memory.

func RegisterCleaner Uses

func RegisterCleaner(cleaner CleanerFunc) CancelFunc

RegisterCleaner is responsible for registering a cleaner function. When a function is registered, the Signal watcher is started in a goroutine.

type CleanerFunc Uses

type CleanerFunc func() error

CleanerFunc is a function to be executed when an interrupt trigger

Package interrupt imports 5 packages (graph) and is imported by 2 packages. Updated 2019-09-14. Refresh now. Tools for package owners.