Get the destination for result by task id. Returns: Tuple[str, str]: tuple of ``(reply_to, correlation_id)``.
(self, task_id, request)
| 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 |
no outgoing calls