Go to file
git d42efb69d6
feat: use list&watch for pending task (#4)
* feat: use watch for next task

* feat: use watch for next task
2024-05-19 23:03:10 +08:00
brokers/etcd feat: use list&watch for pending task (#4) 2024-05-19 23:03:10 +08:00
examples chore: add examples (#2) 2024-05-19 20:24:36 +08:00
.gitignore init commit 2024-05-19 20:09:59 +08:00
LICENSE Initial commit 2024-05-19 20:00:34 +08:00
README.md chore: update readme (#3) 2024-05-19 20:39:45 +08:00
go.mod chore: add examples (#2) 2024-05-19 20:24:36 +08:00
go.sum chore: add examples (#2) 2024-05-19 20:24:36 +08:00

README.md

machinery-plugins

This project is intended to provide multi broker, lock, backend for the RichardKnop/machinery library. About Machinery is an asynchronous task queue/job queue based on distributed message passing. This plugins library offers additional functionalities and tools to help you better utilize and customize Machinery.

Features

This library provides the following features:

  • Brokers: add etcd / mysql
  • Locks add etcd / mysql
  • Backends: add etcd / mysql

you can combine whatever you want

Quick Start

Install the library:

go get github.com/ifooth/machinery-plugins@latest

Import the library in your code and use it to create tasks:

import (
    "github.com/RichardKnop/machinery/v2"
    redisbackend "github.com/RichardKnop/machinery/v2/backends/redis"
    eagerlock "github.com/RichardKnop/machinery/v2/locks/eager"
    etcdbroker "github.com/ifooth/machinery-plugins/brokers/etcd"
)

func main() {
    // Create server instance
	// broker := redisbroker.NewGR(cnf, []string{"localhost:6379"}, 1)
	broker, err := etcdbroker.New(cnf, "http://127.0.0.1:2379")
	if err != nil {
		return nil, err
	}

	lock := eagerlock.New()
	backend := redisbackend.NewGR(cnf, []string{"localhost:6379"}, 3)
	server := machinery.NewServer(cnf, broker, backend, lock)
}

Contributing

We welcome contributions in any form! If you have any issues, suggestions, or wish to add new features, let us know by creating an issue or pull request.

License

machinery-plugins is based on the Apache 2.0 protocol. Please refer to LICENSE for details.