[PR #181] [MERGED] v0.10.0 #655

Closed
opened 2026-03-02 05:54:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/181
Author: @hibiken
Created: 7/6/2020
Status: Merged
Merged: 7/6/2020
Merged by: @hibiken

Base: masterHead: next


📝 Commits (10+)

  • f01c7b8 Add redis key for deadlines in base package
  • 0e70a14 Change TaskMessage Timeout and Deadline to int
  • 68e6b37 Use default timeout of 30mins if both timeout and deadline are not
  • 5afb486 Add task message to deadlines set on dequeue
  • 4ea5805 Update RDB.Dequeue to return message and deadline
  • bee784c Update RDB.Done to remove message from deadlines set
  • 02b653d Update RDB.Retry to remove message from deadlines set
  • 08ac779 Update RDB.Kill to remove message from deadlines set
  • 7433b94 Update RDB.Dequeue to return deadline as time.Time
  • 88d94a2 Update RDB.Requeue to remove message from deadlines set

📊 Changes

32 files changed (+1675 additions, -508 deletions)

View changed files

📝 CHANGELOG.md (+10 -0)
📝 README.md (+9 -4)
📝 benchmark_test.go (+9 -9)
📝 client.go (+88 -14)
📝 client_test.go (+179 -54)
📝 context.go (+3 -14)
📝 context_test.go (+41 -50)
📝 doc.go (+2 -2)
📝 go.mod (+1 -1)
📝 go.sum (+7 -15)
📝 heartbeat.go (+2 -2)
📝 internal/asynqtest/asynqtest.go (+35 -7)
📝 internal/base/base.go (+19 -23)
📝 internal/base/base_test.go (+18 -21)
📝 internal/rdb/inspect.go (+14 -14)
📝 internal/rdb/inspect_test.go (+13 -13)
📝 internal/rdb/rdb.go (+132 -56)
📝 internal/rdb/rdb_test.go (+403 -89)
📝 internal/testbroker/testbroker.go (+14 -2)
📝 processor.go (+81 -54)

...and 12 more files

📄 Description

Added Features

  • Automatic recovery of tasks in the event of a worker crash
  • Automatic retry of tasks which exceeded its timeout/deadline

Version 0.10.0 includes the following API changes:

(*Client).Enqueue, (*Client).EnqueueIn, and (*Client).EnqueueAt has changed to return a *Result and error. A Result struct contains metadata about task that was enqueued (e.g. ID, Queue, etc).
ErrorHandler signature has changed to func(context.Context, *Task, error).

Version 0.10.0 includes the following semantics changes:

All tasks now require timeout or deadline. By default, timeout is set to 1800 seconds(30 mins) if neither of them are specified.
Tasks that exceed its deadline are automatically retried. In the previous versions, User provided Handler needed to explicitly return an error when ctx.Done channel is closed. In the new version, this is taken care of by the library. In order to avoid processing tasks when its deadline is exceeded, Handler should always check ctx.Done channel and stop processing when the channel is closed.

Other important changes:

Encoding schema for messages has changed. Install the latest CLI and run migrate command if you have tasks enqueued with the previous version of asynq.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynq/pull/181 **Author:** [@hibiken](https://github.com/hibiken) **Created:** 7/6/2020 **Status:** ✅ Merged **Merged:** 7/6/2020 **Merged by:** [@hibiken](https://github.com/hibiken) **Base:** `master` ← **Head:** `next` --- ### 📝 Commits (10+) - [`f01c7b8`](https://github.com/hibiken/asynq/commit/f01c7b8e6696970335a74fb76f88d0b48f802b22) Add redis key for deadlines in base package - [`0e70a14`](https://github.com/hibiken/asynq/commit/0e70a148992cc11e3a1847baa437efaaeef53357) Change TaskMessage Timeout and Deadline to int - [`68e6b37`](https://github.com/hibiken/asynq/commit/68e6b379fc97618740bdba51e075223c6c052903) Use default timeout of 30mins if both timeout and deadline are not - [`5afb486`](https://github.com/hibiken/asynq/commit/5afb4861a5cbabc2ee3beef6d3765374c5180a70) Add task message to deadlines set on dequeue - [`4ea5805`](https://github.com/hibiken/asynq/commit/4ea58052f84a7ce5d0a5346cba47bf898dfd0ebe) Update RDB.Dequeue to return message and deadline - [`bee784c`](https://github.com/hibiken/asynq/commit/bee784c052d871ec50a1c2a5b7dbb6003b2c7f63) Update RDB.Done to remove message from deadlines set - [`02b653d`](https://github.com/hibiken/asynq/commit/02b653df727e38109755a3188b85107dea193339) Update RDB.Retry to remove message from deadlines set - [`08ac779`](https://github.com/hibiken/asynq/commit/08ac7793abc7a3c9f5693800dc40342c6268b4ae) Update RDB.Kill to remove message from deadlines set - [`7433b94`](https://github.com/hibiken/asynq/commit/7433b94aac6037526b4d4f71404925752e19f821) Update RDB.Dequeue to return deadline as time.Time - [`88d94a2`](https://github.com/hibiken/asynq/commit/88d94a2a9d701ffca30fc0690dbe27de666056fc) Update RDB.Requeue to remove message from deadlines set ### 📊 Changes **32 files changed** (+1675 additions, -508 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+10 -0) 📝 `README.md` (+9 -4) 📝 `benchmark_test.go` (+9 -9) 📝 `client.go` (+88 -14) 📝 `client_test.go` (+179 -54) 📝 `context.go` (+3 -14) 📝 `context_test.go` (+41 -50) 📝 `doc.go` (+2 -2) 📝 `go.mod` (+1 -1) 📝 `go.sum` (+7 -15) 📝 `heartbeat.go` (+2 -2) 📝 `internal/asynqtest/asynqtest.go` (+35 -7) 📝 `internal/base/base.go` (+19 -23) 📝 `internal/base/base_test.go` (+18 -21) 📝 `internal/rdb/inspect.go` (+14 -14) 📝 `internal/rdb/inspect_test.go` (+13 -13) 📝 `internal/rdb/rdb.go` (+132 -56) 📝 `internal/rdb/rdb_test.go` (+403 -89) 📝 `internal/testbroker/testbroker.go` (+14 -2) 📝 `processor.go` (+81 -54) _...and 12 more files_ </details> ### 📄 Description #### Added Features - Automatic recovery of tasks in the event of a worker crash - Automatic retry of tasks which exceeded its timeout/deadline #### Version 0.10.0 includes the following API changes: `(*Client).Enqueue`, `(*Client).EnqueueIn`, and `(*Client).EnqueueAt` has changed to return a `*Result` and error. A Result struct contains metadata about task that was enqueued (e.g. ID, Queue, etc). `ErrorHandler` signature has changed to `func(context.Context, *Task, error)`. #### Version 0.10.0 includes the following semantics changes: All tasks now require timeout or deadline. By default, timeout is set to 1800 seconds(30 mins) if neither of them are specified. Tasks that exceed its deadline are automatically retried. In the previous versions, User provided Handler needed to explicitly return an error when ctx.Done channel is closed. In the new version, this is taken care of by the library. In order to avoid processing tasks when its deadline is exceeded, Handler should always check ctx.Done channel and stop processing when the channel is closed. #### Other important changes: Encoding schema for messages has changed. Install the latest CLI and run migrate command if you have tasks enqueued with the previous version of asynq. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 05:54:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#655
No description provided.