[GH-ISSUE #649] [FEATURE REQUEST] Support rescheduling a task #321

Open
opened 2026-03-02 05:20:27 +03:00 by kerem · 3 comments
Owner

Originally created by @robinjoseph08 on GitHub (Apr 27, 2023).
Original GitHub issue: https://github.com/hibiken/asynq/issues/649

Originally assigned to: @hibiken on GitHub.

Is your feature request related to a problem? Please describe.
From what I can tell, there doesn't seem to be a way to reschedule a task i.e. create a task with a specific value for asynq.Process{At,In} and afterward, be able to have it run at another given time.

Describe the solution you'd like
Exposing a function either on the Client or on the Inspector that allows for this functionality, similar to Inspector.DeleteTask.

Describe alternatives you've considered
While it's possible to delete the existing task and then create a new one with the new time, it would be nice to preserve the task ID. We maintain a reference to the ID (so that we can delete/reschedule/etc.), and it would be nice to not have to update the IDs when we need to reschedule it, and rescheduling seems like reasonable functionality for a package that handles delayed tasks.

Originally created by @robinjoseph08 on GitHub (Apr 27, 2023). Original GitHub issue: https://github.com/hibiken/asynq/issues/649 Originally assigned to: @hibiken on GitHub. **Is your feature request related to a problem? Please describe.** From what I can tell, there doesn't seem to be a way to reschedule a task i.e. create a task with a specific value for `asynq.Process{At,In}` and afterward, be able to have it run at another given time. **Describe the solution you'd like** Exposing a function either on the `Client` or on the `Inspector` that allows for this functionality, similar to `Inspector.DeleteTask`. **Describe alternatives you've considered** While it's possible to delete the existing task and then create a new one with the new time, it would be nice to preserve the task ID. We maintain a reference to the ID (so that we can delete/reschedule/etc.), and it would be nice to not have to update the IDs when we need to reschedule it, and rescheduling seems like reasonable functionality for a package that handles delayed tasks.
Author
Owner

@reechou commented on GitHub (Jun 12, 2023):

I need this FEATURE too. @hibiken

<!-- gh-comment-id:1586575487 --> @reechou commented on GitHub (Jun 12, 2023): I need this FEATURE too. @hibiken
Author
Owner

@Enan01 commented on GitHub (Nov 4, 2024):

i need too.

<!-- gh-comment-id:2454529253 --> @Enan01 commented on GitHub (Nov 4, 2024): i need too.
Author
Owner

@kamikazechaser commented on GitHub (Nov 5, 2024):

I think there are a couple workarounds to achieve this effect using the current state of the library. Within the task handler itself, you could requeue the same task (callback like style) preserving any metadata as is (including the task ID) and modifying the next processIn/At time.

<!-- gh-comment-id:2456244204 --> @kamikazechaser commented on GitHub (Nov 5, 2024): I think there are a couple workarounds to achieve this effect using the current state of the library. Within the task handler itself, you could requeue the same task (callback like style) preserving any metadata as is (including the task ID) and modifying the next processIn/At time.
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#321
No description provided.