lib_gc_messages_collector

package
v0.0.0-...-e28984d Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CURRENT_ON_BUILDING_PACKAGE_LENGTH = expvar.NewInt("CURRENT_ON_BUILDING_PACKAGE_LENGTH")

Initializing counters

View Source
var DISCARDED_MESSAGES = expvar.NewInt("DISCARDED_MESSAGES")
View Source
var Dummy struct{}
View Source
var EchoSendingErrors bool

If is set to true, the sending errors will be sent to SendingErrorsChan channel

View Source
var MessagesCollectorChan chan *Message

Messages collector chan

View Source
var PACKAGES_SENDING_ERRORS = expvar.NewInt("PACKAGES_SENDING_ERRORS")
View Source
var PENDING_RETRYING_PAKCAGES = expvar.NewInt("PENDING_RETRYING_PAKCAGES")
View Source
var SendingErrorsChan chan *Package

Sending's errors chan. The failed sending tries, will be sent to this channel This channel must be consumed it EcoSendingErrors property is set to true

View Source
var TIMEOUT_INITIALIZING_LOT = 1000
View Source
var TIMEOUT_PACKAGE_CLOSING = 1000
View Source
var TIMEOUT_PUTTING_MESSAGE = 10000
View Source
var TIMEOUT_SENDING_CHECKING = 1000

Functions

This section is empty.

Types

type Message

type Message struct {
	Id             int64
	CreationTime   int64
	Ttl            time.Duration
	SendingRetries int16
	Content        interface{}
	Sender         string
}

func BuildMessageHelper

func BuildMessageHelper(content interface{}, id int64, specializedSender string, Ttl time.Duration) *Message

---------------------------------------- helpers

type MessageSenderFactory_I

type MessageSenderFactory_I interface {
	AddMessageSender(string, MessageSenderFunc)
	RemoveMessageSender(string) (MessageSenderFunc, error)
	GetSender(string) (MessageSenderFunc, error)
}

List of available senders. Each one of them, specialized in an specific sending target.

var MessageSenderFactory MessageSenderFactory_I

type MessageSenderFunc

type MessageSenderFunc func(message *Package) (*Package, error)

type Package

type Package struct {
	Sender        string
	Queue         *lib_gc_fifo.Fifo
	Id            int64
	SendingErrors []error
}

Jump to

Keyboard shortcuts

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