promise

package
v0.11.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Promise

type Promise interface {
	IsComplete() bool
	Complete(errors []error)
	Await() []error
	AwaitUntil(timeout time.Duration) []error
	AndThen(f func([]error))
	AndThenUntil(timeout time.Duration, f func([]error))
}

A disposable write-once latch, to act as a synchronization barrier to signal completion of some asynchronous operation (successful or otherwise).

Functions that operate on this type (IsComplete, Complete, Await, AwaitUntil) are idempotent and thread-safe.

func NewPromise

func NewPromise() Promise

type RendezVous

type RendezVous interface {
	IsComplete() bool
	A()
	B()
}

A reciprocal promise that makes it easy for two coordinating routines A and B to wait on each other before proceeding.

func NewRendezVous

func NewRendezVous() RendezVous

Jump to

Keyboard shortcuts

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