subscriber

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateWorkerCount

func CalculateWorkerCount(amountOfTopics int) int

CalculateWorkerCount will calculate the amount of workers that will be spawned based on the following formula: Available CPU's * 2 / Amount of Topics

Types

type Connector

type Connector interface {
	Start()
	End()
}

Connector is the interface for the RabbitMQ Connector. Allowing for starting & stopping it.

func NewConnector

func NewConnector(config *config.Controller, client types.Invoker, factory rabbitmq.QueueConsumerFactory) Connector

NewConnector generates a connector using the provided parameters.

type Subscriber

type Subscriber interface {
	Start() error
	Stop() error

	IsRunning() bool
}

Subscriber subscribes to an topic on Rabbit MQ. It can also be seen as a worker.

func NewSubscriber

func NewSubscriber(name string, topic string, consumer rabbitmq.QueueConsumer, client types.Invoker) Subscriber

NewSubscriber setups a new subscriber for the given topic.

Jump to

Keyboard shortcuts

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