#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):

 When you say custom objects, are you referring to `TaskContext`? As far as
 I understand, `TaskContext` is provided by the tasks framework and it is
 not customizable, right?

 The only piece that seems outside the control of the tasks framework is
 TaskResult, which can contain an arbitrary task return value. However,
 according to the docs (https://docs.djangoproject.com/en/6.0/topics/tasks
 /#enqueueing-tasks), "Because both Task arguments and return values are
 serialized to JSON, they must be JSON-serializable". That’s what led me to
 wonder about this.

 In any case, I see your point and it makes sense. Still, in my particular
 use case (and I guess it may also help some other possible backends for
 which context needs to be passed to the worker through some channel?) it
 could simplify several things if the context were JSON-serializable :-)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36919#comment:10>
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/0107019ce3c063a6-785d713f-c3ce-4ee1-9266-33466b2625be-000000%40eu-central-1.amazonses.com.

Reply via email to