Hmm
This commit is contained in:
parent
1094fce783
commit
44890aced6
1 changed files with 2 additions and 2 deletions
|
@ -5,14 +5,14 @@ from typing import Optional
|
|||
class ActionQueue:
|
||||
def __init__(self) -> None:
|
||||
self.queued_actions: asyncio.Queue = asyncio.Queue()
|
||||
self.idle_action: Optional[any] = None
|
||||
self.idle_action: tuple = (None,[],{})
|
||||
self.queue_task = asyncio.create_task(self.run_queue())
|
||||
self.idle_action_task = None
|
||||
|
||||
async def run_queue(self):
|
||||
# try:
|
||||
while True:
|
||||
if self.queued_actions.empty() and self.idle_action is not None:
|
||||
if self.queued_actions.empty() and self.idle_action[0] is not None:
|
||||
self.idle_action_task = asyncio.create_task(self.idle_action[0](*(self.idle_action[1]), **(self.idle_action[2])))
|
||||
|
||||
action = await self.queued_actions.get()
|
||||
|
|
Loading…
Reference in a new issue