taskqueue

package
v0.0.0-...-86aba4e Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(consumer rabbitmq.Consumer, queueName, routingKey string) *Consumer

func (*Consumer) StartConsuming

func (c *Consumer) StartConsuming(handler func(taskID uuid.UUID) error) error

StartConsuming consumes tasks and calls handler for each of them. If a message cannot be unmarshalled, it's discarded. If handler fails, the message is requeued. Otherwise, the message is acked.

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(publisher *rabbitmq.Publisher, exchangeName string, routingKey string) *Producer

func (*Producer) Produce

func (p *Producer) Produce(task Task) error

type Task

type Task struct {
	ID uuid.UUID `json:"id"`
}

Jump to

Keyboard shortcuts

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