mq

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrefetchCount int
)

Functions

func Close

func Close()

func FatalWorker

func FatalWorker(timeout time.Duration)

func Init

func Init(uri string) (err error)

func RunConsumerForChannelWithCancelAndDbConn

func RunConsumerForChannelWithCancelAndDbConn(consumer ConsumerWithDbConn, messageChannel MessageChannel, database *db.Instance, concurrent bool, ctx context.Context)

Types

type Consumer

type Consumer func(amqp.Delivery)

type ConsumerWithDbConn

type ConsumerWithDbConn func(*db.Instance, amqp.Delivery)

type MessageChannel

type MessageChannel <-chan amqp.Delivery

func (MessageChannel) GetMessage

func (mc MessageChannel) GetMessage() amqp.Delivery

type Queue

type Queue string
const (
	TxNotifications             Queue = "txNotifications"
	Subscriptions               Queue = "subscriptions"
	RawTransactions             Queue = "rawTransactions"
	RawTransactionsSearcher     Queue = "rawTransactionsSearcher"
	RawTransactionsTokenIndexer Queue = "rawTransactionsTokenIndexer"
	TokensRegistration          Queue = "tokensRegistration"
)

func (Queue) Declare

func (q Queue) Declare() error

func (Queue) GetMessageChannel

func (q Queue) GetMessageChannel() MessageChannel

func (Queue) Publish

func (q Queue) Publish(body []byte) error

func (Queue) RunConsumer

func (q Queue) RunConsumer(consumer Consumer)

func (Queue) RunConsumerWithCancel

func (q Queue) RunConsumerWithCancel(consumer Consumer, ctx context.Context)

func (Queue) RunConsumerWithCancelAndDbConn

func (q Queue) RunConsumerWithCancelAndDbConn(consumer ConsumerWithDbConn, database *db.Instance, ctx context.Context)

func (Queue) RunConsumerWithCancelAndDbConnConcurrent added in v1.1.14

func (q Queue) RunConsumerWithCancelAndDbConnConcurrent(consumer ConsumerWithDbConn, database *db.Instance, ctx context.Context)

Jump to

Keyboard shortcuts

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