dispatcher

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHTTPRequest

func ToHTTPRequest(msg *pb.Message) (*http.Request, error)

ToHTTPRequest converts a protobuf message into an http.Request

Types

type Config

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

Config contains configuration for the dispatcher

func New

func New(pool pool.Pool, collect collector.Collector, url, redisChannel string, buffer int, replication float64) *Config

New returns a configured dispatcher

func (*Config) Replications

func (c *Config) Replications(random float64) int

Replications returns the number of replication that should be pushed to the pool

func (*Config) Start

func (c *Config) Start() Dispatcher

Start receives from the configured redis channel, converts the message into a http.Request and pushes it to the pool for replication the configured number of times

func (*Config) Stop

func (c *Config) Stop()

Stop stops consuming the redis channel and cleans up resources

type Dispatcher

type Dispatcher interface {
	Start() Dispatcher
	Stop()
}

The Dispatcher basically ETLs from a datasource (e.g. a redis channel) to a processor (i.e. a pool.Pool) a configurable number of times

Jump to

Keyboard shortcuts

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