processors

package
v0.0.0-...-2a50342 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2015 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTimeout is the default timeout duration specified in seconds
	DefaultTimeout time.Duration
	// DefaultClient is an instance of the custom http.Client created with with the DefaultTimeout
	// (The returned client has a more leniant redirect policy always URL encoding/escaping the location prior to redirect)
	DefaultClient *http.Client
)

Functions

func CreateClient

func CreateClient(timeout time.Duration) *http.Client

CreateClient is used to instantiate a custom http.Client with the specified timeout The returned client has a more leniant redirect policy always URL encoding/escaping the location prior to redirect TODO keep a cache of most commonly used clients so we can reuse them in the same way as we do for `DefaultClient`

Types

type BatchedResponse

type BatchedResponse struct {
	Sequence           int
	Status             string
	Proto              string
	Header             *http.Header
	Body               *bytes.Reader
	ProcessingDuration time.Duration
}

BatchedResponse is a simple type used as a container for the HTTP responses returned by ProcessBatch

func ProcessBatch

func ProcessBatch(requests []*http.Request, timeout time.Duration) ([]*BatchedResponse, error)

ProcessBatch sends a batch of HTTP requests using http.Client. Each request is sent concurrently in a seperate goroutine. The HTTP responses are returned in the same sequence as their corresponding requests.

Jump to

Keyboard shortcuts

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