queuesender

package
v0.0.0-...-fe13f99 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 16 Imported by: 10

Documentation

Overview

Package queuesender implements asynchronous http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

Sender sends JSON requests asynchronously

func New

func New(endpoint string, size int, name string, logger log.Logger) (
	*Sender, error)

New returns a new sender. endpoint is the common base of all endpoints. size is the size of the queue. name is the name of queue. Used strictly for logging. logger is the logger to receive the logs.

func (*Sender) ErrorCount

func (s *Sender) ErrorCount() uint64

func (*Sender) LastError

func (s *Sender) LastError() string

func (*Sender) Register

func (s *Sender) Register(name string) error

Register registers metrics for this instance with tricorder. Metrics registered under "/asyncWriters/<name>"

func (*Sender) Send

func (s *Sender) Send(endpoint string, json interface{})

Send sends given json to the given endpoint. Send will block if queue if full because of encountered errors.

func (*Sender) SuccessCount

func (s *Sender) SuccessCount() uint64

Jump to

Keyboard shortcuts

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