aboutsummaryrefslogtreecommitdiffstats
path: root/slack/task.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-11-20 19:35:28 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commit7ad074083492e78c66e705b97699c92e5d38541a (patch)
treeb455ddc72b6c7dbf69375a9063d611617da88d78 /slack/task.py
parent9934388d03ff6cee5302383cfd231c0e559f7ffa (diff)
downloadwee-slack-7ad074083492e78c66e705b97699c92e5d38541a.tar.gz
Create buffers on connect
Diffstat (limited to 'slack/task.py')
-rw-r--r--slack/task.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/slack/task.py b/slack/task.py
index 2caf264..27abd48 100644
--- a/slack/task.py
+++ b/slack/task.py
@@ -1,6 +1,6 @@
from __future__ import annotations
-from typing import Any, Awaitable, Coroutine, Generator, Tuple, TypeVar
+from typing import Any, Awaitable, Coroutine, Generator, List, Tuple, TypeVar
from uuid import uuid4
import weechat
@@ -75,6 +75,11 @@ def create_task(
return task
+async def await_all_concurrent(requests: List[Coroutine[Any, Any, T]]) -> List[T]:
+ tasks = [create_task(request) for request in requests]
+ return [await task for task in tasks]
+
+
async def sleep(milliseconds: int):
future = FutureTimer()
weechat.hook_timer(