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.