async

package
v0.0.0-...-c937b9e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Promise

func Promise(f func() error) chan error

Promise is a basic promise implementation: it wraps calls a function in a goroutine, and returns a channel which will later return the function's return value.

Types

type Async

type Async interface {
	Cancel()
	Result() <-chan error
}

func All

func All(asyncs ...Async) Async

group asyncs and return grouped err after all async is finished

func Any

func Any(asyncs ...Async) Async

group asyncs and return err in Result for the first async with error

func New

func New(parent context.Context, f func(ctx context.Context) error) Async

type GroupError

type GroupError struct {
	Errs []error
}

func (*GroupError) Error

func (e *GroupError) Error() string

Jump to

Keyboard shortcuts

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