diff --git a/hyx/bulkhead/api.py b/hyx/bulkhead/api.py index 15ef91d..1528a94 100644 --- a/hyx/bulkhead/api.py +++ b/hyx/bulkhead/api.py @@ -4,7 +4,7 @@ from hyx.bulkhead.events import _BULKHEAD_LISTENERS, BulkheadListener from hyx.bulkhead.manager import BulkheadManager -from hyx.events import EventDispatcher, EventManager +from hyx.events import EventDispatcher, EventManager, get_default_name from hyx.typing import FuncT @@ -40,9 +40,9 @@ def __init__( ) self._manager = BulkheadManager( + name=name or get_default_name(), max_concurrency=max_concurrency, max_capacity=max_capacity, - name=name, event_dispatcher=event_dispatcher.as_listener, ) diff --git a/hyx/events.py b/hyx/events.py index 3b8bcda..96900fe 100644 --- a/hyx/events.py +++ b/hyx/events.py @@ -184,6 +184,6 @@ def get_default_name(func: Optional[Callable] = None) -> str: return func.__name__ # this is more for context managers - traceback.extract_stack(limit=3) - # TODO: - return "" + stack = traceback.extract_stack(limit=3) + + return stack[0].name