Skip to content

Commit

Permalink
Fix for dispatchers queue creation
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Mar 22, 2024
1 parent 8730f04 commit bcf7d89
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/ert/ensemble_evaluator/evaluator_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, ensemble: Ensemble, config: EvaluatorServerConfig, iter_: int
self._done: asyncio.Future[bool] = asyncio.Future()

self._clients: Set[WebSocketServerProtocol] = set()
self._dispatchers_connected: Optional[asyncio.Queue[None]] = None
self._dispatchers_connected: Optional[asyncio.Queue[None]] = asyncio.Queue()

self._events: asyncio.Queue[CloudEvent] = asyncio.Queue()
self._messages: asyncio.Queue[str] = asyncio.Queue()
Expand Down Expand Up @@ -269,11 +269,6 @@ async def handle_client(

@asynccontextmanager
async def count_dispatcher(self) -> AsyncIterator[None]:
# do this here (not in __init__) to ensure the queue
# is created on the right event-loop
if self._dispatchers_connected is None:
self._dispatchers_connected = asyncio.Queue()

await self._dispatchers_connected.put(None)

Check failure on line 272 in src/ert/ensemble_evaluator/evaluator_async.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "None" of "Queue[None] | None" has no attribute "put"
yield
await self._dispatchers_connected.get()

Check failure on line 274 in src/ert/ensemble_evaluator/evaluator_async.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Item "None" of "Queue[None] | None" has no attribute "get"
Expand Down

0 comments on commit bcf7d89

Please sign in to comment.