Help us shape the future of Go! Take the 2026 Go Developer Survey

interrupt

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package interrupt maps Ctrl-C onto a running loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

Watcher: the first Ctrl-C stops the loop after its current iteration, a second aborts outright.

func NewWatcher

func NewWatcher(stderr io.Writer) *Watcher

func (*Watcher) Aborted

func (w *Watcher) Aborted() bool

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context, cancel context.CancelFunc, loop *loop.Loop)

Jump to

Keyboard shortcuts

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