liteq

package
v0.0.0-...-b868a91 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TimeWithMsSqlite = "STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')"

TimeWithMsSqlite ... Special constant to get a time with milliseconds. This is helpful for checkout as the timeout might be sub second

Variables

This section is empty.

Functions

This section is empty.

Types

type Liteq

type Liteq struct {
	DB     *sql.DB
	Prefix string
	TTL    time.Duration
	// contains filtered or unexported fields
}

Liteq Structure for sqlite

func (*Liteq) Commit

func (l *Liteq) Commit(recipts []*gq.Receipt) error

Commit ... Removes any messages that bave been comsusumed by the b

func (*Liteq) ConsumeBatch

func (l *Liteq) ConsumeBatch(size int) ([]*gq.ConsumerMessage, error)

ConsumeBatch ... This consumes a number of messages up to the limit

func (*Liteq) Create

func (l *Liteq) Create() error

Create ... builds any required tables

func (*Liteq) Destroy

func (l *Liteq) Destroy() error

Destroy ... removes any tables

func (*Liteq) Exit

func (l *Liteq) Exit() bool

Exit ...

func (*Liteq) Publish

func (l *Liteq) Publish(messages []*gq.Message) error

Publish ... This pushes a list of messages into the DB

func (*Liteq) StopConsumer

func (l *Liteq) StopConsumer()

StopConsumer ... Stop consuming messages

func (*Liteq) Stream

func (l *Liteq) Stream(size int, messages chan []*gq.ConsumerMessage, pause time.Duration)

Stream ... Creates a stream of consumption

Jump to

Keyboard shortcuts

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