Ping all (or specific) workers. >>> app.control.inspect().ping() {'celery@node1': {'ok': 'pong'}, 'celery@node2': {'ok': 'pong'}} >>> app.control.inspect().ping(destination=['celery@node1']) {'celery@node1': {'ok': 'pong'}} Arguments: destination
(self, destination=None)
| 272 | registered_tasks = registered |
| 273 | |
| 274 | def ping(self, destination=None): |
| 275 | """Ping all (or specific) workers. |
| 276 | |
| 277 | >>> app.control.inspect().ping() |
| 278 | {'celery@node1': {'ok': 'pong'}, 'celery@node2': {'ok': 'pong'}} |
| 279 | >>> app.control.inspect().ping(destination=['celery@node1']) |
| 280 | {'celery@node1': {'ok': 'pong'}} |
| 281 | |
| 282 | Arguments: |
| 283 | destination (List): If set, a list of the hosts to send the |
| 284 | command to, when empty broadcast to all workers. |
| 285 | |
| 286 | Returns: |
| 287 | Dict: Dictionary ``{HOSTNAME: {'ok': 'pong'}}``. |
| 288 | |
| 289 | See Also: |
| 290 | :meth:`broadcast` for supported keyword arguments. |
| 291 | """ |
| 292 | if destination: |
| 293 | self.destination = destination |
| 294 | return self._request('ping') |
| 295 | |
| 296 | def active_queues(self): |
| 297 | """Return information about queues from which worker consumes tasks. |