Revert "Refactor command system to be queue based"

This reverts commit 28957a4b60.
This commit is contained in:
Alex Wolden
2025-08-29 11:57:22 -07:00
parent 9aeffb41a1
commit ccb1d6eb9e
12 changed files with 516 additions and 376 deletions

View File

@@ -1,4 +1,3 @@
from collections.abc import Coroutine
from enum import Enum
import inspect
import logging
@@ -116,7 +115,7 @@ class EventDispatcher:
def subscribe(
self,
event_type: Union[EventType, None],
callback: Callable[[Event], Coroutine[Any, Any, None]],
callback: Callable[[Event], Union[None, asyncio.Future]],
attribute_filters: Optional[Dict[str, Any]] = None,
) -> Subscription:
"""
@@ -229,7 +228,7 @@ class EventDispatcher:
"""
future = asyncio.Future()
async def event_handler(event: Event):
def event_handler(event: Event):
if not future.done():
future.set_result(event)