MCPcopy
hub / github.com/celery/celery / store_result

Method store_result

celery/backends/rpc.py:254–271  ·  view source on GitHub ↗

Send task return value and state.

(self, task_id, result, state,
                     traceback=None, request=None, **kwargs)

Source from the content-addressed store, hash-verified

252 return 'rpc://'
253
254 def store_result(self, task_id, result, state,
255 traceback=None, request=None, **kwargs):
256 """Send task return value and state."""
257 routing_key, correlation_id = self.destination_for(task_id, request)
258 if not routing_key:
259 return
260 with self.app.amqp.producer_pool.acquire(block=True) as producer:
261 producer.publish(
262 self._to_result(task_id, state, result, traceback, request),
263 exchange=self.exchange,
264 routing_key=routing_key,
265 correlation_id=correlation_id,
266 serializer=self.serializer,
267 retry=True, retry_policy=self.retry_policy,
268 declare=self.on_reply_declare(task_id),
269 delivery_mode=self.delivery_mode,
270 )
271 return result
272
273 def _to_result(self, task_id, state, result, traceback, request):
274 return {

Callers

nothing calls this directly

Calls 5

destination_forMethod · 0.95
_to_resultMethod · 0.95
on_reply_declareMethod · 0.95
acquireMethod · 0.80
publishMethod · 0.45

Tested by

no test coverage detected