Skip to content

Latest commit

 

History

History
74 lines (37 loc) · 1.41 KB

deadline.md

File metadata and controls

74 lines (37 loc) · 1.41 KB

deadline

import "github.com/andy2046/gopie/pkg/deadline"

Package deadline implements Deadline pattern.

deadline.go

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

ErrTimeout is the error for deadline timeout.

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

Deadline represents the deadline.

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.


Generated by godoc2md