forked from M-Labs/kirdy
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.
|
||||
"""
|
||||
if self.connected():
|
||||
try:
|
||||
self._task_queue.put_nowait(lambda: awaitable_fn)
|
||||
return True
|
||||
except asyncio.queues.QueueFull:
|
||||
return False
|
||||
else:
|
||||
raise ConnectionError
|
||||
|
||||
|
|
Loading…
Reference in New Issue