pebblequeue

package module
v0.0.0-...-fe89f1e Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 8 Imported by: 0

README

work-pebblequeue

An implementation of the Queue interface from github:taylorchu/work for pebble.

Usage

func main() {
    db, err := pebble.Open("pebble_test", &pebble.Options{})
	if err != nil {
		t.Fatal(err)
	}
	defer db.Close()
    queue := work.NewPebbleQueue(db)

	job := work.NewJob()
	type message struct {
		Text string
	}

	job := work.NewJob()
	err = job.MarshalPayload(message{Text: "hello"})
    if err != nil {
        log.Fatalln(err)
    }
	err = queue.Enqueue(job, &work.EnqueueOptions{
		Namespace: "{ns1}",
		QueueID:   "cmd_queue",
	})
	if err != nil {
		log.Fatalln(err)
	}
}

Caveats

Don't use multiple proccesses to connect to the same databese. Pebble is not designed for that. If you need to use multiple processes, use a different database. In the case of using this package, it is expected that the producer and consumer are sharing the same pebble "connection", and are goroutines in the same procecss.

License

This project is a largely based on the existing redis queue implementation in work, which is licensed under the MIT license, so this project is also licensed under the MIT license to ensure compliance. A very big thank you to Taylor Chu for their work (no pun intended) on work.

You can see work, and it's documentation here: https://github.com/taylorchu/work

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPebbleQueue

func NewPebbleQueue(db *pebble.DB) work.Queue

Types

This section is empty.

Jump to

Keyboard shortcuts

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