diff options
Diffstat (limited to 'bitbake/lib/hashserv/__init__.py')
-rw-r--r-- | bitbake/lib/hashserv/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/__init__.py b/bitbake/lib/hashserv/__init__.py index f95e8f43f1..622ca17a91 100644 --- a/bitbake/lib/hashserv/__init__.py +++ b/bitbake/lib/hashserv/__init__.py | |||
@@ -3,6 +3,7 @@ | |||
3 | # SPDX-License-Identifier: GPL-2.0-only | 3 | # SPDX-License-Identifier: GPL-2.0-only |
4 | # | 4 | # |
5 | 5 | ||
6 | import asyncio | ||
6 | from contextlib import closing | 7 | from contextlib import closing |
7 | import re | 8 | import re |
8 | import sqlite3 | 9 | import sqlite3 |
@@ -113,3 +114,15 @@ def create_client(addr): | |||
113 | c.connect_tcp(*a) | 114 | c.connect_tcp(*a) |
114 | 115 | ||
115 | return c | 116 | return c |
117 | |||
118 | async def create_async_client(addr): | ||
119 | from . import client | ||
120 | c = client.AsyncClient() | ||
121 | |||
122 | (typ, a) = parse_address(addr) | ||
123 | if typ == ADDR_TYPE_UNIX: | ||
124 | await c.connect_unix(*a) | ||
125 | else: | ||
126 | await c.connect_tcp(*a) | ||
127 | |||
128 | return c | ||