kinesisPool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Mutex

	ID int64
	// contains filtered or unexported fields
}

Client is the thread that connect to the remote redis server

func NewClient

func NewClient(srv *Server) *Client

NewClient creates a new client that connects to a kinesis

func (*Client) Exit

func (clt *Client) Exit()

Exit finish the go routine of the client

type Config

type Config struct {
	// Internal clients details
	MaxWorkers      int
	ThresholdWarmUp float64
	Interval        time.Duration
	CoolDownPeriod  time.Duration
	Critical        bool // Handle this stream as critical
	Serializer      func(i interface{}) ([]byte, error)

	// Limits
	Buffer        int
	ConcatRecords bool // Contact many rows in one Kinesis record
	MaxRecords    int  // To send in batch to Kinesis
	Compress      bool // Compress records with snappy

	// Authentication and enpoints
	StreamName string // Kinesis/Kinesis stream name
	Region     string // AWS region
	Profile    string // AWS Profile name
}

Config is the general configuration for the server

type Server

type Server struct {
	sync.Mutex

	C chan interface{}
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Server

New create a pool of workers

func (*Server) Exit

func (srv *Server) Exit()

Exit terminate all clients and close the channels

func (*Server) Reload

func (srv *Server) Reload(cfg *Config) (err error)

Reload the configuration

func (*Server) Waiting

func (srv *Server) Waiting()

Waiting to the server if is running

Jump to

Keyboard shortcuts

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