deadline

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package deadline implements Deadline pattern.

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("time out executing function")

ErrTimeout is the error for deadline timeout.

Functions

This section is empty.

Types

type Deadline

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

Deadline represents the deadline.

func New

func New(timeout time.Duration) *Deadline

New returns a new Deadline with the provided timeout.

func (*Deadline) Go

func (d *Deadline) Go(fn func(<-chan struct{}) error) error

Go executes the provided function with a done channel as parameter to signal the timeout.

Jump to

Keyboard shortcuts

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