mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #109] [Proposal] Change Payload to bytes & Add Wrapper around Key-Value pair payload #1048
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#1048
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 @hibiken on GitHub (Mar 11, 2020).
Original GitHub issue: https://github.com/hibiken/asynq/issues/109
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
I'm always frustrated when I need to call
GetXmethod for all the values in Payload to get all the data (also need to make sure that I don't make a typo in payload key string).It'd be nice if
asynqsupported en/decoding protobuf or gob message directly so that I can load that data to an object with one method call.Describe the solution you'd like
initial proposal:
Describe alternatives you've considered
None for now.
Additional context
None for now.
@hibiken commented on GitHub (Mar 13, 2020):
Closing this for now.
@andygrunwald commented on GitHub (Feb 22, 2021):
Hey @hibiken,
coming back to this, because I am running the same problem here.
Would love to store []byte in the message itself.
What was your reasoning for closing this?
@hibiken commented on GitHub (Feb 22, 2021):
Hey @andygrunwald thanks for your comment!
I'm actually considering changing the signature of
NewTasktoand add a nice wrapper around the payload to make it easier to do key-value pairs like the current API supports.
something like:
I'll open this issue again so that it's more visible to people.
In the meantime, is it possible to workaround this by storing the bytes as string in the payload?
@andygrunwald commented on GitHub (Feb 22, 2021):
Thanks @hibiken.
I thought about something similar.
Didn't check this yet. Need to do another test.
However, I am also running into this issue:
I think the []byte payload is able to solve both.
@andygrunwald commented on GitHub (Feb 23, 2021):
Related to https://github.com/hibiken/asynq/issues/245
@hibiken commented on GitHub (Feb 23, 2021):
@andygrunwald Would you mind describing the issue you're seeing?
I want to understand your use case so that I can take that into account when I make API change to support storing payload as
[]byte.@disc commented on GitHub (Mar 11, 2021):
Hello @hibiken
I have the same issue when consumer tried to execute task with this payload:
Payload:
The full message is:
If I change key from eventType to abc in the payload everything is ok and no errors occur.
Is there any way to fix it?
@disc commented on GitHub (Mar 11, 2021):
^^ UPD:
I found the difference, the keys of object sorted in different way, looks like expected payload sorted alphabetically.
Payload in redis queue
asynq:{app.event}:activePayload in consumer
The problem related to php producer, json_encode method does not work as json.Marshal in golang
@hibiken commented on GitHub (Mar 11, 2021):
@disc Thanks for updating this issue.
Just to clarify, you're enqueueing a task using PHP client? Not using
asynq.Client?FYI: This issue should go away in the next release. I'm currently working on redis key re-design so that we only need to move IDs around and don't need to use JSON data to remove entry from redis sets.
@disc commented on GitHub (Mar 11, 2021):
Yes, I wrote PHP client for asynq, it just produces a message to the redis queue as the asynq worker expects
@hibiken commented on GitHub (Mar 11, 2021):
That's great! I should probably document the message schema in Wiki so that people can write clients in other languages :)
Related: #105