#36919: Allow `TaskResult` (and `Task`) to be pickled
-------------------------------------+-------------------------------------
Reporter: Jake Howard | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Tasks | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by matiasb):
Hi!
Somehow related to this. While exploring an implementation of a Celery
backend for Django’s task framework, I ran into a serialization issue
related to `takes_context=True`. When set, the task callable receives a
`TaskContext` instance containing execution metadata, including the
current `TaskResult`.
Celery serializes task arguments before sending them to workers, and the
default serializer is JSON. `TaskContext` (and specifically the embedded
`TaskResult`) is not JSON serializable, which in my case leads to errors
like:
`kombu.exceptions.EncodeError: Object of type TaskContext is not JSON
serializable`
It would be great if it could be possible not only make this pickable but
also JSON-serializable?
--
Ticket URL: <https://code.djangoproject.com/ticket/36919#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019ce2e727ca-d90d58b3-9002-497c-ba11-d3eaecd01c9a-000000%40eu-central-1.amazonses.com.