MCPcopy
hub / github.com/celery/celery / result_from_tuple

Function result_from_tuple

celery/result.py:1073–1092  ·  view source on GitHub ↗

Deserialize result from tuple.

(r, app=None)

Source from the content-addressed store, hash-verified

1071
1072
1073def result_from_tuple(r, app=None):
1074 """Deserialize result from tuple."""
1075 # earlier backends may just pickle, so check if
1076 # result is already prepared.
1077 app = app_or_default(app)
1078 Result = app.AsyncResult
1079 if not isinstance(r, ResultBase):
1080 res, nodes = r
1081 id, parent = res if isinstance(res, (list, tuple)) else (res, None)
1082 if parent:
1083 parent = result_from_tuple(parent, app)
1084
1085 if nodes is not None:
1086 return app.GroupResult(
1087 id, [result_from_tuple(child, app) for child in nodes],
1088 parent=parent,
1089 )
1090
1091 return Result(id, parent=parent)
1092 return r

Callers 10

test_AsyncResultMethod · 0.90
test_with_parentMethod · 0.90
test_compatMethod · 0.90
test_GroupResultMethod · 0.90
_restore_groupMethod · 0.90
unlock_chordFunction · 0.90
groupFunction · 0.90
_set_cacheMethod · 0.85

Calls 1

GroupResultMethod · 0.80

Tested by 6

test_AsyncResultMethod · 0.72
test_with_parentMethod · 0.72
test_compatMethod · 0.72
test_GroupResultMethod · 0.72