Comments (11)
That's great! I should probably document the message schema in Wiki so that people can write clients in other languages :)
Related: #105
from asynq.
Closing this for now.
from asynq.
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?
from asynq.
Hey @andygrunwald thanks for your comment!
I'm actually considering changing the signature of NewTask
to
func NewTask(typename string, payload []byte) *Task
and add a nice wrapper around the payload to make it easier to do key-value pairs like the current API supports.
something like:
t := NewTask("mytask", asynq.KV(map[string]interface{}{"mykey": 123}))
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?
from asynq.
Thanks @hibiken.
I thought about something similar.
In the meantime, is it possible to workaround this by storing the bytes as string in the payload?
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.
from asynq.
Related to #245
from asynq.
@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
.
from asynq.
Hello @hibiken
I have the same issue when consumer tried to execute task with this payload:
WARN: Could not remove task id=f83cca71-620b-45ff-a309-c6917dd2f248 type="app.event" from "asynq:{app.event}:active" err: NOT FOUND; Will retry syncing
Payload:
{"eventType": "Signup", "countryCode": "au"}
The full message is:
{"Type":"app.event","Payload":{"countryCode":"au","eventType":"Signup"},"ID":"5663097f-6cb7-4464-b1d2-b6a8c5a59bb7","Queue":"app.event","Retry":25,"Retried":0,"ErrorMsg":"","Timeout":1800,"Deadline":0,"UniqueKey":""}
If I change key from eventType to abc in the payload everything is ok and no errors occur.
{"abc": "Signup", "countryCode": "au"}
Is there any way to fix it?
from asynq.
^^ 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}:active
"Payload":{"eventType":"Signup","countryCode":"au"}"
Payload in consumer
"Payload":{"countryCode":"au","eventType":"Signup"}"
The problem related to php producer, json_encode method does not work as json.Marshal in golang
from asynq.
@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.
from asynq.
@disc Thanks for updating this issue.
Just to clarify, you're enqueueing a task using PHP client? Not usingasynq.Client
?
Yes, I wrote PHP client for asynq, it just produces a message to the redis queue as the asynq worker expects
from asynq.
Related Issues (20)
- [FEATURE REQUEST] customize serializer
- Discussion/Suggestion: Decoupling `x` and `tools` packages.
- [BUG] Unable to schedule a task HOT 1
- Timing issues when running certain tests
- [FEATURE REQUEST] Settable maxArchiveSize HOT 1
- [BUG] Delete archived task fail, when task has been evicted from archived zset. HOT 2
- [FEATURE REQUEST] Unique option for run time of task
- [FEATURE REQUEST] aggregation task optimization
- handler not found for task "ping:worker"
- [FEATURE REQUEST] Custom ticker value for heartbeater duration HOT 4
- Scheduler: How to get the schedule time of the task in the task handler? HOT 1
- [FEATURE REQUEST] Exposing MinIdleConns redis config HOT 3
- [BUG] Description of the bug HOT 1
- [FEATURE REQUEST] can add opt for cron to set second HOT 2
- [FEATURE REQUEST] Process task with ratelimit HOT 2
- [BUG] After manually deleted redis keys, some of the features like metrics, inspector aren't working properly
- [FEATURE REQUEST] Wrap the payload contents in the CLI's Task Info modal
- [FEATURE REQUEST] How can I specific worker concurrency for each queue
- [FEATURE REQUEST] pause server
- [BUG] Asynq task didn't got processed by the worker even after many hours of getting picked up HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynq.