mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #203] [FEATURE REQUEST] Is it possible to trigger a callback when status of a task is changed? #1084
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#1084
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sujit-baniya on GitHub (Oct 10, 2020).
Original GitHub issue: https://github.com/hibiken/asynq/issues/203
Originally assigned to: @hibiken on GitHub.
Is it possible to trigger a function whenever status of a task is changed?
For e.g. trigger a function when task A changed it's status from
PENDINGtoACTIVESimilar stuff for queue and workers:
If queue and/or workers are idle for specific time period, stop or kill such queue and/or workers to restore the resources
For e.g.
Is there something I could do?
@hibiken commented on GitHub (Oct 11, 2020):
Thanks for opening this issue.
It's an interesting feature request, but with the current implementation this change will most likely degrade the performance significantly (e.g. we would need to deserialize the task message whenever there's a status change). I'm hesitant to make this change at this moment, but you can fork the repo and make appropriate changes in the
internal/rdbpackage where task messages are managed in redis.I will keep this issue open to see if this is a popular feature request.
As for the second question:
That's why we have
TimeoutandDeadlineoption. You can read about it in this wiki page.@sujit-baniya commented on GitHub (Oct 12, 2020):
@hibiken Thanks for the response. I wonder those options are for Task and not Workers or Queues.
@hibiken commented on GitHub (Oct 13, 2020):
Yes, the timeout and deadline are specific to each task. A worker has limited time to process a task, if the worker cannot complete its task within the timeout (or before the deadline), the task will be retried later and the worker is abandoned to reclaim resources.
I'm not quite sure what you mean by
Could you explain this in more detail?
@sujit-baniya commented on GitHub (Oct 13, 2020):
For e.g.
application created workerA on QueueA for 100K jobs. After 10 mins all jobs are completed. Now I need remove the workerA and QueueA from server after waiting or being idle for specific time period
@hibiken commented on GitHub (Feb 1, 2021):
Currently I'm not intending to support this feature. I'll close this issue for now.