forked from goodboy/tractor
1
0
Fork 0

`.discovery.get_arbiter()`: add warning around this now deprecated usage

multihomed
Tyler Goodlet 2023-12-11 19:37:45 -05:00
parent 3f15923537
commit f415fc43ce
1 changed files with 12 additions and 2 deletions

View File

@ -76,8 +76,18 @@ async def get_registry(
yield regstr_ptl yield regstr_ptl
# TODO: deprecate and remove _arbiter form
get_arbiter = get_registry # TODO: deprecate and this remove _arbiter form!
@acm
async def get_arbiter(*args, **kwargs):
warnings.warn(
'`tractor.get_arbiter()` is now deprecated!\n'
'Use `.get_registry()` instead!',
DeprecationWarning,
stacklevel=2,
)
async with get_registry(*args, **kwargs) as to_yield:
yield to_yield
@acm @acm