File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 22
22
from __future__ import annotations
23
23
from typing import (
24
24
AsyncGenerator ,
25
+ AsyncContextManager ,
25
26
TYPE_CHECKING ,
26
27
)
27
28
from contextlib import asynccontextmanager as acm
@@ -190,11 +191,19 @@ async def maybe_open_portal_from_reg_addr(
190
191
else :
191
192
yield None
192
193
194
+ if not registry_addrs :
195
+ from ._root import _default_lo_addrs
196
+ registry_addrs = _default_lo_addrs
197
+
198
+ maybe_portals : list [
199
+ AsyncContextManager [tuple [str , int ]]
200
+ ] = list (
201
+ maybe_open_portal_from_reg_addr (addr )
202
+ for addr in registry_addrs
203
+ )
204
+
193
205
async with gather_contexts (
194
- mngrs = list (
195
- maybe_open_portal_from_reg_addr (addr )
196
- for addr in registry_addrs
197
- )
206
+ mngrs = maybe_portals ,
198
207
) as maybe_portals :
199
208
print (f'Portalz: { maybe_portals } ' )
200
209
if not maybe_portals :
@@ -206,6 +215,9 @@ async def maybe_open_portal_from_reg_addr(
206
215
yield portals [0 ]
207
216
208
217
else :
218
+ # TODO: currently this may return multiple portals
219
+ # given there are multi-homed or multiple registrars..
220
+ # SO, we probably need de-duplication logic?
209
221
yield portals
210
222
211
223
You can’t perform that action at this time.
0 commit comments