Skip to content

Commit

Permalink
Implemented the default name for context managers
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-glushko committed Nov 7, 2023
1 parent b028bb6 commit dbc7eb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hyx/bulkhead/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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,
)

Expand Down
6 changes: 3 additions & 3 deletions hyx/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dbc7eb9

Please sign in to comment.