MCPcopy
hub / github.com/celery/celery / destination_for

Method destination_for

celery/backends/rpc.py:225–238  ·  view source on GitHub ↗

Get the destination for result by task id. Returns: Tuple[str, str]: tuple of ``(reply_to, correlation_id)``.

(self, task_id, request)

Source from the content-addressed store, hash-verified

223 maybe_declare(self.binding(producer.channel), retry=True)
224
225 def destination_for(self, task_id, request):
226 """Get the destination for result by task id.
227
228 Returns:
229 Tuple[str, str]: tuple of ``(reply_to, correlation_id)``.
230 """
231 # Backends didn't always receive the `request`, so we must still
232 # support old code that relies on current_task.
233 try:
234 request = request or current_task.request
235 except AttributeError:
236 raise RuntimeError(
237 f'RPC backend missing task request for {task_id!r}')
238 return request.reply_to, request.correlation_id or task_id
239
240 def on_reply_declare(self, task_id):
241 # Return value here is used as the `declare=` argument

Callers 2

store_resultMethod · 0.95
test_destination_forMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_destination_forMethod · 0.64