execution

package
v0.0.0-...-9649366 Latest Latest
Warning

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

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

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