@@ -131,17 +131,13 @@ def enqueue(self, *args: P.args, **kwargs: P.kwargs) -> "TaskResult[T]":
131
131
"""
132
132
Queue up the task to be executed
133
133
"""
134
- return self .get_backend ().enqueue (
135
- self , json_normalize (args ), json_normalize (kwargs )
136
- )
134
+ return self .get_backend ().enqueue (self , args , kwargs )
137
135
138
136
async def aenqueue (self , * args : P .args , ** kwargs : P .kwargs ) -> "TaskResult[T]" :
139
137
"""
140
138
Queue up a task function (or coroutine) to be executed
141
139
"""
142
- return await self .get_backend ().aenqueue (
143
- self , json_normalize (args ), json_normalize (kwargs )
144
- )
140
+ return await self .get_backend ().aenqueue (self , args , kwargs )
145
141
146
142
def get_result (self , result_id : str ) -> "TaskResult[T]" :
147
143
"""
@@ -319,6 +315,10 @@ class TaskResult(Generic[T]):
319
315
320
316
_return_value : T | None = field (init = False , default = None )
321
317
318
+ def __post_init__ (self ) -> None :
319
+ object .__setattr__ (self , "args" , json_normalize (self .args ))
320
+ object .__setattr__ (self , "kwargs" , json_normalize (self .kwargs ))
321
+
322
322
@property
323
323
def return_value (self ) -> T | None :
324
324
"""
0 commit comments