queue

package
v0.0.0-...-d81a630 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("queue connection closed")
)

Functions

This section is empty.

Types

type Message

type Message struct {
	Body     []byte
	Internal interface{}
}

type NewQueueOpts

type NewQueueOpts struct {
	Username      string
	Password      string
	Host          string
	Port          string
	PrefetchCount uint64
}

type Queue

type Queue interface {
	Start(ctx context.Context, queueName string) error
	Close(ctx context.Context)
	Publish(
		ctx context.Context,
		queueName string,
		msg []byte,
		headers map[string]interface{},
		expiration *string,
	) error
	Notify(ctx context.Context, wg *sync.WaitGroup) error
	Subscribe(ctx context.Context, msgs chan<- Message, wg *sync.WaitGroup) error
	Ack(ctx context.Context, msg Message) error
	Nack(ctx context.Context, msg Message, requeue bool) error
}

type QueueMessageProcessedBody

type QueueMessageProcessedBody struct {
	Message bridge.IBridgeMessage
	ID      int
}

type QueueMessageSentBody

type QueueMessageSentBody struct {
	Event        *bridge.BridgeMessageSent
	ID           int
	TimesRetried uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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