driver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerController

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

func NewConsumerController

func NewConsumerController() *ConsumerController

func (*ConsumerController) Data

func (c *ConsumerController) Data() <-chan Message

func (*ConsumerController) Done

func (c *ConsumerController) Done() chan struct{}

func (*ConsumerController) Send

func (c *ConsumerController) Send(m Message)

func (*ConsumerController) Stop

func (c *ConsumerController) Stop()

type Driver

type Driver interface {
	Enqueue(queue string, data []byte, opts ...func(message any)) error
	Consume(queue string, opts ...func(message any)) (*ConsumerController, error)
	Ack(queue string, messageID string) error
	Ping() error
}

type MemoryDriver

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

func NewMemoryDriver

func NewMemoryDriver(tick time.Duration) *MemoryDriver

func (*MemoryDriver) Ack

func (d *MemoryDriver) Ack(queue, messageID string) error

func (*MemoryDriver) Consume

func (d *MemoryDriver) Consume(queue string, opts ...func(message any)) (*ConsumerController, error)

func (*MemoryDriver) Enqueue

func (d *MemoryDriver) Enqueue(queue string, evt []byte, opts ...func(message any)) error

func (*MemoryDriver) Ping added in v0.2.0

func (d *MemoryDriver) Ping() error

type Message

type Message struct {
	Body  []byte
	ID    string
	Error error
}

Jump to

Keyboard shortcuts

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