mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #584] [BUG] Unable to pass context using EnqueueContext. #2305
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#2305
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 @divnoorkang on GitHub (Dec 8, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/584
Originally assigned to: @hibiken on GitHub.
Describe the bug
My context contains some data that i need to access in my workers. I am trying to pass the context using EnqueueContext function provided. Though this function is creating its own context, and my original context is lost somewhere in the process of dequeuing.
Correct context is being carrier till this point, post this not able to find anything.
To Reproduce
Attaching images of context passed


and received
Expected behavior
Context must be same as the one passed
Environment (please complete the following information):
@hibiken commented on GitHub (Dec 19, 2022):
Ah this may be a documentation bug. The feature is working as intended.
As it mentioned in the API doc , the first argument "ctx" applied to the enqueue operation. The content of context is not serialized and passed the worker process.
If you need to provide data to the worker, please use the payload of the task instead.