summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/asyncrpc/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/asyncrpc/client.py')
-rw-r--r--bitbake/lib/bb/asyncrpc/client.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/asyncrpc/client.py b/bitbake/lib/bb/asyncrpc/client.py
index 50e60d5c31..34960197d1 100644
--- a/bitbake/lib/bb/asyncrpc/client.py
+++ b/bitbake/lib/bb/asyncrpc/client.py
@@ -7,6 +7,7 @@ import asyncio
7import json 7import json
8import os 8import os
9import socket 9import socket
10import sys
10from . import chunkify, DEFAULT_MAX_CHUNK 11from . import chunkify, DEFAULT_MAX_CHUNK
11 12
12 13
@@ -129,7 +130,7 @@ class Client(object):
129 # required (but harmless) with it. 130 # required (but harmless) with it.
130 asyncio.set_event_loop(self.loop) 131 asyncio.set_event_loop(self.loop)
131 132
132 self._add_methods('connect_tcp', 'close', 'ping') 133 self._add_methods('connect_tcp', 'ping')
133 134
134 @abc.abstractmethod 135 @abc.abstractmethod
135 def _get_async_client(self): 136 def _get_async_client(self):
@@ -163,3 +164,9 @@ class Client(object):
163 @max_chunk.setter 164 @max_chunk.setter
164 def max_chunk(self, value): 165 def max_chunk(self, value):
165 self.client.max_chunk = value 166 self.client.max_chunk = value
167
168 def close(self):
169 self.loop.run_until_complete(self.client.close())
170 if sys.version_info >= (3, 6):
171 self.loop.run_until_complete(self.loop.shutdown_asyncgens())
172 self.loop.close()