nats

package
v0.0.0-...-4670c47 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TaskEventChannel for task event pubsub
	TaskEventChannel string = "gocelerytaskevent"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Broker implements Nats broker

func (*Broker) Close

func (b *Broker) Close() error

Close the broker and cleans up resources

func (*Broker) Connect

func (b *Broker) Connect(uri string) error

Connect to rabbitmq

func (*Broker) GetTaskResult

func (b *Broker) GetTaskResult(taskID string) <-chan *broker.Message

GetTaskResult fetchs task result for the specified taskID

func (*Broker) GetTasks

func (b *Broker) GetTasks(queue string) <-chan *broker.Message

GetTasks waits and fetches the tasks from queue

func (*Broker) PublishTask

func (b *Broker) PublishTask(queueName, key string, message *broker.Message, ignoreResults bool) error

PublishTask sends a task to queue

func (*Broker) PublishTaskEvent

func (b *Broker) PublishTaskEvent(key string, message *broker.Message) error

PublishTaskEvent sends task events back to event queue

func (*Broker) PublishTaskResult

func (b *Broker) PublishTaskResult(key string, message *broker.Message) error

PublishTaskResult sends task result back to task queue

Jump to

Keyboard shortcuts

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