Skip to content

Commit

Permalink
chore: add loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Apr 22, 2024
1 parent b6d3333 commit 12d57af
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions a_sync/primitives/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ def __await__(self):
return self.result() # May raise too.
self._asyncio_future_blocking = True
self._waiters.add(current_task := asyncio.current_task(self._loop))
if len(self._waiters) > 1:
logger.info("awaiting %s again")
logger.debug("awaiting %s", self)
yield self # This tells Task to wait for completion.
self._waiters.remove(current_task)
Expand Down Expand Up @@ -274,11 +272,14 @@ def _get(self):
async def _worker_coro(self) -> NoReturn:
args: P.args
kwargs: P.kwargs
fut: asyncio.Future[V]
fut: SmartFuture[V]
while True:
try:
args, kwargs, fut = await self.get()
logger.info("processing %s", fut)
if fut.num_waiters > 1:
logger.info("processing %s", fut)
else:
logger.debug("processing %s", fut)
result = await self.func(*args, **kwargs)
logger.info("result: %s", result)
fut.set_result(result)
Expand Down

0 comments on commit 12d57af

Please sign in to comment.