queue

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Debug

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

func (*Debug) GetQueueLength

func (m *Debug) GetQueueLength(queue string) (map[string]int64, error)

func (*Debug) GetQueues

func (m *Debug) GetQueues() ([]string, error)

func (*Debug) GetTopicLength

func (m *Debug) GetTopicLength(queue, topic string) (int64, error)

func (*Debug) GetTopics

func (m *Debug) GetTopics() (map[string][]string, error)

func (*Debug) MaxDelay

func (m *Debug) MaxDelay() time.Duration

func (*Debug) Ping

func (m *Debug) Ping() error

func (*Debug) Read

func (m *Debug) Read(_ context.Context, queue, topic string, ch chan<- queue.MessageWrapper) error

func (*Debug) Type

func (m *Debug) Type() string

func (*Debug) Write

func (m *Debug) Write(_ context.Context, queue string, delay time.Duration, content []byte) error

type EmptyIdempotent

type EmptyIdempotent struct{}

func (*EmptyIdempotent) AfterProcess

func (p *EmptyIdempotent) AfterProcess(_ queue.Message, _ queue.ProcessStatus)

AfterProcess is invoked after processing.

func (*EmptyIdempotent) BeforeProcess

func (p *EmptyIdempotent) BeforeProcess(_ queue.Message) bool

BeforeProcess is invoked before process message.

type Message

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

func (*Message) Begin

func (m *Message) Begin()

Begin to process the message.

func (*Message) Cancel

func (m *Message) Cancel()

Cancel indicates the message should be ignored.

func (*Message) Content

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

Content returns the message body content.

func (*Message) End

func (m *Message) End()

End indicates a successful process.

func (*Message) Fail

func (m *Message) Fail()

Fail indicates a failed process.

func (*Message) IsPing

func (m *Message) IsPing() bool

IsPing returns true for a ping message.

func (*Message) NotBefore

func (m *Message) NotBefore() time.Time

NotBefore indicates the message should not be processed before this timestamp.

func (*Message) Queue

func (m *Message) Queue() string

Queue name of this message.

func (*Message) Requeue

func (m *Message) Requeue()

Requeue indicates the message should be retried.

func (*Message) Retry

func (m *Message) Retry() int

Retry times.

func (*Message) Timestamp

func (m *Message) Timestamp() time.Time

Timestamp indicates the creation time of the message.

func (*Message) Topic

func (m *Message) Topic() string

Topic name of this message.

func (*Message) UniqueID

func (m *Message) UniqueID() string

UniqueID returns the unique ID of this message.

type Queue

type Queue struct{}

func (*Queue) Publish

func (m *Queue) Publish(name string, content []byte, opts ...queue.PublishOption) error

Publish writes a message body to the specified queue name.

func (*Queue) Subscribe

func (m *Queue) Subscribe(name string, handler queue.Consumer, opts ...queue.SubscribeOption) error

Subscribe consumes the messages of the specified queue.

Jump to

Keyboard shortcuts

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