Skip to content

Commit

Permalink
Revert checks
Browse files Browse the repository at this point in the history
  • Loading branch information
x42005e1f authored Dec 11, 2024
1 parent 4c0c964 commit 640957f
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions janus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def close(self) -> None:
for fut in self._pending:
fut.cancel()
if self._async_tasks_done_waiting:
assert self._loop is not None
self._call_soon_threadsafe( # unblocks all async_q.join()
self._make_async_tasks_done_notifier, self._loop
)
if self._loop is not None:
self._call_soon_threadsafe( # unblocks all async_q.join()
self._make_async_tasks_done_notifier, self._loop
)
if self._sync_tasks_done_waiting:
self._sync_tasks_done.notify_all() # unblocks all sync_q.join()

Expand Down Expand Up @@ -281,10 +281,10 @@ def task_done(self) -> None:
if parent._sync_tasks_done_waiting:
parent._sync_tasks_done.notify_all()
if parent._async_tasks_done_waiting:
assert parent._loop is not None
parent._call_soon_threadsafe(
parent._make_async_tasks_done_notifier, parent._loop
)
if parent._loop is not None:
parent._call_soon_threadsafe(
parent._make_async_tasks_done_notifier, parent._loop
)
parent._unfinished_tasks = unfinished

def join(self) -> None:
Expand Down Expand Up @@ -382,10 +382,10 @@ def put(self, item: T, block: bool = True, timeout: OptFloat = None) -> None:
if parent._sync_not_empty_waiting:
parent._sync_not_empty.notify()
if parent._async_not_empty_waiting:
assert parent._loop is not None
parent._call_soon_threadsafe(
parent._make_async_not_empty_notifier, parent._loop
)
if parent._loop is not None:
parent._call_soon_threadsafe(
parent._make_async_not_empty_notifier, parent._loop
)

def get(self, block: bool = True, timeout: OptFloat = None) -> T:
"""Remove and return an item from the queue.
Expand Down Expand Up @@ -428,10 +428,10 @@ def get(self, block: bool = True, timeout: OptFloat = None) -> T:
if parent._sync_not_full_waiting:
parent._sync_not_full.notify()
if parent._async_not_full_waiting:
assert parent._loop is not None
parent._call_soon_threadsafe(
parent._make_async_not_full_notifier, parent._loop
)
if parent._loop is not None:
parent._call_soon_threadsafe(
parent._make_async_not_full_notifier, parent._loop
)
return item

def put_nowait(self, item: T) -> None:
Expand Down Expand Up @@ -637,10 +637,10 @@ def task_done(self) -> None:
parent._unfinished_tasks -= 1
if parent._unfinished_tasks == 0:
if parent._async_tasks_done_waiting:
assert parent._loop is not None
parent._call_soon_threadsafe(
parent._make_async_tasks_done_notifier, parent._loop
)
if parent._loop is not None:
parent._call_soon_threadsafe(
parent._make_async_tasks_done_notifier, parent._loop
)
if parent._sync_tasks_done_waiting:
parent._sync_tasks_done.notify_all()

Expand Down

0 comments on commit 640957f

Please sign in to comment.