rabbitmq

package
v0.0.0-...-7a62f64 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobDefinition

type JobDefinition struct {
	Exchange       *exchange.Definition
	Queue          *queue.Definition
	Job            worker.Job
	ConcurrentJobs uint32
}

func NewJobDefinition

func NewJobDefinition(queue *queue.Definition, exchange *exchange.Definition, job worker.Job, concurrentJobs uint32) *JobDefinition

type Worker

type Worker struct {
	*worker.WorkerBase
	// contains filtered or unexported fields
}

A RabbitMQ worker that will subscribe to a queue and execute a job for each message received

func NewWorker

func NewWorker(channel *amqp.Channel, jobDef *JobDefinition, opts ...WorkerOpt) *Worker

Returns a new RabbitMQ worker. The worker assumes that the exchange and queue have already been declared.

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

func (*Worker) Stop

func (a *Worker) Stop(ctx context.Context) error

type WorkerOpt

type WorkerOpt func(*Worker)

func WithGetWorkFunc

func WithGetWorkFunc(getWork worker.GetWorkFunc) WorkerOpt

func WithName

func WithName(name string) WorkerOpt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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