broker

package
v0.0.0-...-11b9a83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NoConsumerQueue = "_%s_worker_delayed_5f345b3c-cab6-498a-9bc5-4de9537f8a5b"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPBroker

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

func NewBroker

func NewBroker(url string) *AMQPBroker

func (*AMQPBroker) Enqueue

func (b *AMQPBroker) Enqueue(name, messageID string, message proto.Message) error

func (*AMQPBroker) EnqueueIn

func (b *AMQPBroker) EnqueueIn(name, messageID string, message proto.Message,
	secondsFromNow int64) (string, error)

func (*AMQPBroker) GetMessage

func (b *AMQPBroker) GetMessage(jobName string) (*Message, error)

func (*AMQPBroker) GetQueueStatus

func (b *AMQPBroker) GetQueueStatus(name string) (Status, error)

func (*AMQPBroker) RegisterJob

func (b *AMQPBroker) RegisterJob(jobName string) error

type Message

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

func (*Message) Body

func (m *Message) Body() []byte

func (*Message) ID

func (m *Message) ID() string

func (*Message) Requeue

func (m *Message) Requeue() error

func (*Message) Retries

func (m *Message) Retries() uint8

type Status

type Status struct {
	JobName  string
	Messages int64
	Error    error `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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