mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 15:35:55 +03:00
[GH-ISSUE #291] [FEATURE REQUEST] how to enqueue from nodejs asynq 0.18 #2140
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#2140
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 @acgfbr on GitHub (Jul 13, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/291
Originally assigned to: @hibiken on GitHub.
Hi, today im enqueuing from nodejs in asynq 0.17:
but in asynq 0.18.x payload contains special characters:
how to make this payload in nodejs?
@hibiken commented on GitHub (Jul 14, 2021):
Hi @acgfbr! Thanks for opening this issue :)
We've changed how we store task data in v0.18. Take a look at the following for how it's currently implemented in Go.
github.com/hibiken/asynq@c0ae62499f/internal/rdb/rdb.go (L76)github.com/hibiken/asynq@c0ae62499f/internal/rdb/rdb.go (L130)github.com/hibiken/asynq@c0ae62499f/internal/rdb/rdb.go (L375)github.com/hibiken/asynq@c0ae62499f/internal/rdb/rdb.go (L424)To give you more details, we are using protobuf to encode task message and store each task data under a key in redis.
The format of the key is
"asynq:{<qname>}:t:<task_id>"where qname and task_id depends on the task.The value under this key is HASH type in redis with the following key-value pairs:
The protocol buffer message definition is here: https://github.com/hibiken/asynq/blob/master/internal/proto/asynq.proto
In the long-term, I'd like to create a client package for different languages (https://github.com/hibiken/asynq/issues/105) but in the meantime, you need to look at the Go implementation.
If you are interested, feel free to create a npm package for asynq client in nodeJS. I'll make sure to document it in this repo and maintain it together with this Go package :)
Please let me know if you have more questions!
@crossworth commented on GitHub (Jul 14, 2021):
You can create a simple program using go that takes the job payload as input, enqueue it and call using
execfrom other programming languages.Another approach would be to create a simple http server with go that accepts a request to enqueue a job, that way you could enqueue jobs with anything that can make a http request.