summaryrefslogtreecommitdiffstats
path: root/bitbake/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:18:26 +0100
commitcba7d8f361bbb49021055fc820a68a8198b85f1d (patch)
treebf028bc14dc7e7b111ae53eac4c2bdde423cdcc3 /bitbake/lib/bb/asyncrpc/client.py
parentcbb87447356578c439c2ac636bd619c868afad63 (diff)
downloadpoky-cba7d8f361bbb49021055fc820a68a8198b85f1d.tar.gz
bitbake: 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. (Bitbake rev: 25ccd697ea76f66b813be2296866b2d3405b079c) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/asyncrpc/client.py')
-rw-r--r--bitbake/lib/bb/asyncrpc/client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/asyncrpc/client.py b/bitbake/lib/bb/asyncrpc/client.py
index 4cdad9ac3c..79919c5be6 100644
--- a/bitbake/lib/bb/asyncrpc/client.py
+++ b/bitbake/lib/bb/asyncrpc/client.py
@@ -103,13 +103,18 @@ class AsyncClient(object):
103 103
104 return await self._send_wrapper(proc) 104 return await self._send_wrapper(proc)
105 105
106 async def ping(self):
107 return await self.send_message(
108 {'ping': {}}
109 )
110
106 111
107class Client(object): 112class Client(object):
108 def __init__(self): 113 def __init__(self):
109 self.client = self._get_async_client() 114 self.client = self._get_async_client()
110 self.loop = asyncio.new_event_loop() 115 self.loop = asyncio.new_event_loop()
111 116
112 self._add_methods('connect_tcp', 'close') 117 self._add_methods('connect_tcp', 'close', 'ping')
113 118
114 @abc.abstractmethod 119 @abc.abstractmethod
115 def _get_async_client(self): 120 def _get_async_client(self):