mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #775] [FEATURE REQUEST] Expose method within handler to shutdown server #2406
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#2406
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 @Xenov-X on GitHub (Nov 1, 2023).
Original GitHub issue: https://github.com/hibiken/asynq/issues/775
Originally assigned to: @hibiken on GitHub.
I have a task which I'd like to be the last task performed by the Server, with the server closing following completion. I've tried implementing this sending TSTP/TERM to the current PID running the handler, but the server still processes other tasks.
By way of a simple example,
HandleShutdownTaskshould run, followed by shutdown of the Async server / worker (and then the host shortly after)However, the syscall signal implementation above doesn't work, with other tasks starting to be processed following completion of the above.
Describe the solution you'd like
A means to instruct the Async Server to terminate from within a handler, following completion of the current task.
@g41797 commented on GitHub (Dec 30, 2023):
shutdown should be supported by asynq itself
it's bad idea to kill process if another tasks should be finished of terminated gracefully