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: 30 modules, 50 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址