aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/asyncrpc/client.py
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2021-05-28 09:42:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-06 23:17:30 +0100
commit25ccd697ea76f66b813be2296866b2d3405b079c (patch)
tree2a7f5d8d767ecde1b8f2b49d8e749e1be64286c0 /lib/bb/asyncrpc/client.py
parenta13510d0028e234ea2f4744b0d0c38558395c70f (diff)
downloadbitbake-contrib-25ccd697ea76f66b813be2296866b2d3405b079c.tar.gz
asyncrpc: Add ping method
This method is needed to support startup of the prservice. As it is so generic we can add it to the common asyncrpc module. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/asyncrpc/client.py')
-rw-r--r--lib/bb/asyncrpc/client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/asyncrpc/client.py b/lib/bb/asyncrpc/client.py
index 4cdad9ac3..79919c5be 100644
--- a/lib/bb/asyncrpc/client.py
+++ b/lib/bb/asyncrpc/client.py
@@ -103,13 +103,18 @@ class AsyncClient(object):
return await self._send_wrapper(proc)
+ async def ping(self):
+ return await self.send_message(
+ {'ping': {}}
+ )
+
class Client(object):
def __init__(self):
self.client = self._get_async_client()
self.loop = asyncio.new_event_loop()
- self._add_methods('connect_tcp', 'close')
+ self._add_methods('connect_tcp', 'close', 'ping')
@abc.abstractmethod
def _get_async_client(self):