execution

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextDone

func ContextDone(ctx context.Context, env string) error

ContextDone returns an error if the context was canceled or timed out.

func ExecuteParallel

func ExecuteParallel(ctx context.Context, requests []Request) error

ExecuteParallel executes a slice of requests in parallel

Types

type ErrQueryCanceled

type ErrQueryCanceled string

ErrQueryCanceled is returned if a query was canceled during processing.

func (ErrQueryCanceled) Error

func (e ErrQueryCanceled) Error() string

type ErrQueryTimeout

type ErrQueryTimeout string

ErrQueryTimeout is returned if a query timed out during processing.

func (ErrQueryTimeout) Error

func (e ErrQueryTimeout) Error() string

type Request

type Request interface {
	Process(ctx context.Context) error
}

Request is input for parallel execution

type RequestResponse

type RequestResponse struct {
	Request  Request
	Response *Response
}

RequestResponse is used to combine both request and response in output

type Response

type Response struct {
	Value interface{}
	Err   error
}

Response is returned from parallel execution

Jump to

Keyboard shortcuts

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