def __init__(self, pool: "ConnectionPool"):
self.pool = ref(pool)
- logger.debug("task created in %s: %s", threading.current_thread().name, self)
def __repr__(self) -> str:
pool = self.pool()
pool = self.pool()
if not pool or pool.closed:
# Pool is no more working. Quietly discard the operation.
+ logger.debug("task run discarded: %s", self)
return
logger.debug("task running in %s: %s", threading.current_thread().name, self)
pool = self.pool()
if not pool or pool.closed:
# Pool is no more working. Quietly discard the operation.
+ logger.debug("task tick discarded: %s", self)
return
pool.run_task(self)
pool = self.pool()
if not pool or pool.closed:
# Pool is no more working. Quietly discard the operation.
+ logger.debug("task run discarded: %s", self)
return
await self._run(pool)
pool = self.pool()
if not pool or pool.closed:
# Pool is no more working. Quietly discard the operation.
+ logger.debug("task tick discarded: %s", self)
return
pool.run_task(self)