sigtx

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 3 Imported by: 50

README

sigtx Build Status

This package provides an implementation proposal for this Go proposal: https://github.com/golang/go/issues/21521.

Usage

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/markbates/sigtx"
)

func main() {
	ctx, cancel := sigtx.WithCancel(context.Background(), os.Interrupt)
	defer cancel()
	select {
	case <-ctx.Done():
		fmt.Println("thanks for stopping me")
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCancel

func WithCancel(ctx context.Context, s ...os.Signal) (context.Context, context.CancelFunc)

Types

This section is empty.

Jump to

Keyboard shortcuts

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