From f415fc43ce0ae0110990fe0fba9169d0fa75c472 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 11 Dec 2023 19:37:45 -0500 Subject: [PATCH] `.discovery.get_arbiter()`: add warning around this now deprecated usage --- tractor/_discovery.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tractor/_discovery.py b/tractor/_discovery.py index e5bc8db..8cccc50 100644 --- a/tractor/_discovery.py +++ b/tractor/_discovery.py @@ -76,8 +76,18 @@ async def get_registry( 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