Skip to content

Commit

Permalink
V2 integration tests (RichardKnop#628)
Browse files Browse the repository at this point in the history
* fix: fix redis issues

* fix: fix examples

* feat: v2 integration tests, improvements

* chore: move examples into v1/v2 subfolders
  • Loading branch information
RichardKnop authored Nov 24, 2020
1 parent e69c340 commit ed5f054
Show file tree
Hide file tree
Showing 22 changed files with 1,108 additions and 83 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,28 @@ go get github.com/RichardKnop/machinery/v1

First, you will need to define some tasks. Look at sample tasks in `example/tasks/tasks.go` to see a few examples.

Second, you will need to launch a worker process with one of these commands:
Second, you will need to launch a worker process with one of these commands (v2 is recommended since it doesn't import dependencies for all brokers / backends, only those you actually need):

```sh
go run example/amqp.go worker
go run example/redigo/main.go worker // Redis with redigo driver
go run example/go-redis/main.go worker // Redis with Go Redis driver
go run example/v2/amqp.go worker
go run example/v2/redigo/main.go worker // Redis with redigo driver
go run example/v2/go-redis/main.go worker // Redis with Go Redis driver

go run example/v1/amqp.go worker
go run example/v1/redis.go worker
```

![Example worker][1]

Finally, once you have a worker running and waiting for tasks to consume, send some tasks with one of these commands:
Finally, once you have a worker running and waiting for tasks to consume, send some tasks with one of these commands (v2 is recommended since it doesn't import dependencies for all brokers / backends, only those you actually need):

```sh
go run example/amqp.go send
go run example/redigo/main.go send // Redis with redigo driver
go run example/go-redis/main.go send // Redis with Go Redis driver
go run example/v2/amqp.go send
go run example/v2/redigo/main.go send // Redis with redigo driver
go run example/v2/go-redis/main.go send // Redis with Go Redis driver

go run example/v1/amqp.go send
go run example/v1/redis.go send
```

You will be able to see the tasks being processed asynchronously by the worker:
Expand Down
Loading

0 comments on commit ed5f054

Please sign in to comment.