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

deadline

package
v1.3.104 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package deadline Copied from https://golang.org/src/net/pipe.go with some changes. Package deadline pkg/util/deadline/deadline.go c0-com-util

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipeDeadline

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

PipeDeadline is an abstraction for handling timeouts.

func MakePipeDeadline

func MakePipeDeadline() PipeDeadline

MakePipeDeadline creates a new PipeDeadline

func (*PipeDeadline) Closed

func (d *PipeDeadline) Closed() bool

Closed checks if deadline happened.

func (*PipeDeadline) Set

func (d *PipeDeadline) Set(t time.Time)

Set sets the point in time when the deadline will time out. A timeout event is signaled by closing the channel returned by waiter. Once a timeout has occurred, the deadline can be refreshed by specifying a t value in the future.

A zero value for t prevents timeout.

func (*PipeDeadline) Unset added in v1.3.100

func (d *PipeDeadline) Unset() bool

Unset reports whether no deadline is set, so a wait on it cannot end.

func (*PipeDeadline) Wait

func (d *PipeDeadline) Wait() chan struct{}

Wait returns a channel that is closed when the deadline is exceeded.

Jump to

Keyboard shortcuts

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