MCPcopy
hub / github.com/celery/celery / ping

Method ping

celery/app/control.py:274–294  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 8

assert_pingFunction · 0.45
test_pingMethod · 0.45
test_pingMethod · 0.45
test_pingMethod · 0.45
test_sanityMethod · 0.45
statusFunction · 0.45

Calls 1

_requestMethod · 0.95

Tested by 7

assert_pingFunction · 0.36
test_pingMethod · 0.36
test_pingMethod · 0.36
test_pingMethod · 0.36
test_sanityMethod · 0.36