driver: return whether task queue is full in task_dispatcher()
This commit is contained in:
parent
9bec56ed6c
commit
e8d3858fc9
|
@ -759,7 +759,11 @@ class Kirdy:
|
||||||
Enqueue a task to be handled by the handler.
|
Enqueue a task to be handled by the handler.
|
||||||
"""
|
"""
|
||||||
if self.connected():
|
if self.connected():
|
||||||
self._task_queue.put_nowait(lambda: awaitable_fn)
|
try:
|
||||||
|
self._task_queue.put_nowait(lambda: awaitable_fn)
|
||||||
|
return True
|
||||||
|
except asyncio.queues.QueueFull:
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
raise ConnectionError
|
raise ConnectionError
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue