mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #192] [FEATURE REQUEST] access to the real-executed queue name somewhere #59
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#59
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 @ChristianYeah on GitHub (Sep 15, 2020).
Original GitHub issue: https://github.com/hibiken/asynq/issues/192
Originally assigned to: @hibiken on GitHub.
It seems like there is no way to get the queue name which is processing in especially when the StrictPriority is set to true
@hibiken commented on GitHub (Sep 15, 2020):
@ChristianYeah Thank you for opening this issue!
Which version of the package are you using? And do you have CLI (github.com/hibiken/asynq/tools/asynq) installed as well?
@ChristianYeah commented on GitHub (Sep 15, 2020):
I'm using asynq v0.11.0 currently, and I installed the latest asynq tool as well. However, I prefer to get the queue info in the middleware so I will be able to do some extra stats by myself.
@hibiken commented on GitHub (Sep 15, 2020):
You should be able to see which queues are being processed by running
asynq.Serverby running the following command.But if you'd like to get a hold of queues that are being processed within your code, then I think we need to add a method to the
Inspectortype. Would that help?Side Note: I recently released v0.12 which included a number of breaking changes Please see the release notes for upgrade info when you upgrade.
@ChristianYeah commented on GitHub (Sep 15, 2020):
that will be great. It's not urgent for me currently.
BTW, when I define the ErrorHandler during the server initialization according to the doc, It doesn't work as described in the comments
github.com/hibiken/asynq@82b6828f43/server.go (L101)an error will raise,
Thank you very much
@hibiken commented on GitHub (Sep 15, 2020):
Got it, I'll get to this issue in the next few weeks 👍
Let me make sure that I understood your ask correctly:
Do you need a list of queue names that are currently being processed by
asynq.Server(s)?Sorry about the ErrorHandler. The pacakge is still undergoing API changes from a version to another.
ErrorHandleFuncinterface is nowI'll fix the comment. Thanks for spotting.
Please let me know if you still having issues!
@ChristianYeah commented on GitHub (Sep 15, 2020):
I think the info from asynq tool is sufficient and I can pull the data from Redis for some simple customizations. :)
@hibiken commented on GitHub (Sep 15, 2020):
Sounds good! I'll keep this issue open so that if other people have the same ask, I'll revisit this 👍
@ChristianYeah commented on GitHub (Sep 18, 2020):
@hibiken Hi, Ken.
In my project, I don't care about the retry, but the logging info.
currently, the Task struct has Payload attribute, and Payload's data is private
And the Payload has an attribute called data, which is private.
In my project, I prefer to output the task payload into log directly rather than retring, so I can apply filebeats to servers as I can collect the log or the raw error payload & info by using ELK.
As the data prop is private, in order to minimize the side effect, I simply modify the source code to add a function to encode Payload into json.
function added below
Thank you.
@hibiken commented on GitHub (Sep 18, 2020):
I see. Thanks for this feedback!
It makes sense to have
Payloadimplementfmt.Stringerinterface.I'll make that change soon.
@hibiken commented on GitHub (Sep 20, 2020):
@ChristianYeah I've added
String()andMarchalJSON()methods toPayload. I have a few more changes I want to include in the next version release, so the change hasn't been released yet. But feel free to fork the repo and use it until then!Let me know if you have more feedback 👍