|
2 | 2 |
|
3 | 3 | [](https://godoc.org/github.com/taylorchu/work) |
4 | 4 | [](https://goreportcard.com/report/github.com/taylorchu/work) |
5 | | -[](https://app.fossa.io/projects/git%2Bgithub.com%2Ftaylorchu%2Fwork?ref=badge_shield) |
| 5 | +[](https://app.fossa.com/projects/custom%2B4257%2Fgit%40github.com%3Ataylorchu%2Fwork.git?ref=badge_shield) |
6 | 6 | [](https://circleci.com/gh/taylorchu/work) |
7 | 7 |
|
8 | 8 | Please see `cmd/` for enqueuer and worker demo. |
9 | 9 |
|
10 | 10 | ## Improvements |
11 | 11 |
|
12 | 12 | - [x] queue backend abstraction |
13 | | - - redis is still the default, but the new design allows custom queue implementation. |
| 13 | + - redis is still the default, but the new design allows custom queue implementation. |
14 | 14 | - [x] simplify the keyspace design of redis queue backend |
15 | | - - The new design uses 1 redis hash per job, and 1 redis sorted set for queue. |
16 | | - - [Interesting read](https://kirshatrov.com/2018/07/20/redis-job-queue/) |
| 15 | + - The new design uses 1 redis hash per job, and 1 redis sorted set for queue. |
| 16 | + - [Interesting read](https://kirshatrov.com/2018/07/20/redis-job-queue/) |
17 | 17 | - [x] modular |
18 | | - - The core only catches panics, retries on failure, and waits if a queue is empty. |
19 | | - - All other [functionalities](https://kirshatrov.com/2019/01/03/state-of-background-jobs/) |
20 | | - are either removed or moved to separate middlewares. |
| 18 | + - The core only catches panics, retries on failure, and waits if a queue is empty. |
| 19 | + - All other [functionalities](https://kirshatrov.com/2019/01/03/state-of-background-jobs/) |
| 20 | + are either removed or moved to separate middlewares. |
21 | 21 | - [x] support binary payload/args with message pack. |
22 | 22 | - [x] replace built-in UI with prometheus metrics (use grafana if you want dashboard). |
23 | 23 | - [x] additional optimizations (alloc + bulk queue ops) |
24 | | - ```go |
25 | | - BenchmarkWorkerRunJob/work_v1_1-8 3000 515957 ns/op |
26 | | - BenchmarkWorkerRunJob/work_v2_1-8 5000 284516 ns/op |
27 | | - BenchmarkWorkerRunJob/work_v1_10-8 1000 2136546 ns/op |
28 | | - BenchmarkWorkerRunJob/work_v2_10-8 5000 367997 ns/op |
29 | | - BenchmarkWorkerRunJob/work_v1_100-8 100 18234023 ns/op |
30 | | - BenchmarkWorkerRunJob/work_v2_100-8 1000 1759186 ns/op |
31 | | - BenchmarkWorkerRunJob/work_v1_1000-8 10 162110100 ns/op |
32 | | - BenchmarkWorkerRunJob/work_v2_1000-8 100 12646080 ns/op |
33 | | - BenchmarkWorkerRunJob/work_v1_10000-8 1 1691287122 ns/op |
34 | | - BenchmarkWorkerRunJob/work_v2_10000-8 10 144923087 ns/op |
35 | | - BenchmarkWorkerRunJob/work_v1_100000-8 1 17515722574 ns/op |
36 | | - BenchmarkWorkerRunJob/work_v2_100000-8 1 1502468637 ns/op |
37 | | - PASS |
38 | | - ok github.com/taylorchu/work 87.901s |
39 | | - ``` |
40 | | -- [ ] http enqueuer |
41 | | - |
| 24 | + ```go |
| 25 | + BenchmarkWorkerRunJob/work_v1_1-8 3000 515957 ns/op |
| 26 | + BenchmarkWorkerRunJob/work_v2_1-8 5000 284516 ns/op |
| 27 | + BenchmarkWorkerRunJob/work_v1_10-8 1000 2136546 ns/op |
| 28 | + BenchmarkWorkerRunJob/work_v2_10-8 5000 367997 ns/op |
| 29 | + BenchmarkWorkerRunJob/work_v1_100-8 100 18234023 ns/op |
| 30 | + BenchmarkWorkerRunJob/work_v2_100-8 1000 1759186 ns/op |
| 31 | + BenchmarkWorkerRunJob/work_v1_1000-8 10 162110100 ns/op |
| 32 | + BenchmarkWorkerRunJob/work_v2_1000-8 100 12646080 ns/op |
| 33 | + BenchmarkWorkerRunJob/work_v1_10000-8 1 1691287122 ns/op |
| 34 | + BenchmarkWorkerRunJob/work_v2_10000-8 10 144923087 ns/op |
| 35 | + BenchmarkWorkerRunJob/work_v1_100000-8 1 17515722574 ns/op |
| 36 | + BenchmarkWorkerRunJob/work_v2_100000-8 1 1502468637 ns/op |
| 37 | + PASS |
| 38 | + ok github.com/taylorchu/work 87.901s |
| 39 | + ``` |
| 40 | +- [x] http server |
| 41 | + - [x] delete job |
| 42 | + - [x] create job |
| 43 | + - [x] get job status |
| 44 | + - [x] get queue metrics (kubernetes autoscaler integration with [keda metrics api scaler](https://keda.sh/docs/2.5/scalers/metrics-api/)) |
| 45 | + - [ ] OpenAPI spec |
42 | 46 |
|
43 | 47 | ## License |
44 | | -[](https://app.fossa.io/projects/git%2Bgithub.com%2Ftaylorchu%2Fwork?ref=badge_large) |
| 48 | + |
| 49 | +[](https://app.fossa.com/projects/custom%2B4257%2Fgit%40github.com%3Ataylorchu%2Fwork.git?ref=badge_large) |
0 commit comments