Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Ports PortsConfig `json:"ports"`
Queues map[string]QueueConfig `json:"queues"`
}
Config is the configuration type definition.
type Message ¶
Message struct
func TransformStringToMessage ¶
TransformStringToMessage transforms a string value to a Message struct
type PortsConfig ¶
PortsConfig is the "port" configuration section type definition.
type QueueConfig ¶
QueueConfig is the "queues" configuration section type definition.
type RateCounters ¶
type RateCounters map[string]*ratecounter.RateCounter
RateCounters containers counters
type Worker ¶
type Worker struct {
ID int
Queue string
Message <-chan Message
Processor Processor
Counter *ratecounter.RateCounter
}
Worker struct
func NewWorker ¶
func NewWorker(id int, queue string, processor Processor, message <-chan Message, counter *ratecounter.RateCounter) Worker
NewWorker creates a new Worker instance
type Workmq ¶
type Workmq struct {
Config Config
Queues map[string]chan Message
Processors map[string]Processor
Counters RateCounters
Workers []Worker
Wg sync.WaitGroup
}
Workmq type
func (*Workmq) AddProcessor ¶
AddProcessor adds a processor into the processors list
func (*Workmq) GetProcessor ¶
GetProcessor retrieves a processor from its name
func (*Workmq) ListenHTTP ¶
func (w *Workmq) ListenHTTP()
ListenHTTP creates a HTTP server to expose statistics information
func (*Workmq) ListenUDP ¶
func (w *Workmq) ListenUDP()
ListenUDP creates a UDP server that listens for new messages
func (*Workmq) RemoveProcessor ¶
RemoveProcessor removes a processor from its name
