interruptible

package
v0.0.0-...-fd2add7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIntr = errors.New("interrupted")

Functions

func BufferPipe

func BufferPipe(n int) (Reader, Writer)

ww<–pipe–>wr <–copy–> rw<–pipe–>rr

func Pipe

func Pipe() (Reader, Writer)

Types

type Abort

type Abort chan<- struct{}

func (Abort) Abort

func (a Abort) Abort()

type Intr

type Intr <-chan struct{}

type Mutex

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

Mutex is analgous to sync.Mutex, but the lock operation can be interrupted by the locking user.

func (*Mutex) Lock

func (m *Mutex) Lock(intr Intr) *Unlocker

func (*Mutex) TryLock

func (m *Mutex) TryLock() *Unlocker

type Reader

type Reader interface {
	io.ReadCloser
	ReadIntr([]byte, Intr) (int, error)
}

type Unlocker

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

func (*Unlocker) Unlock

func (u *Unlocker) Unlock()

type Writer

type Writer interface {
	io.WriteCloser
	WriteIntr([]byte, Intr) (int, error)
}

Writer is an io.WriteCloser which also supports interruptible writes.

Jump to

Keyboard shortcuts

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