We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2098e2a + a8f5516 commit f1f0c5cCopy full SHA for f1f0c5c
Week05/awaitme_burak_ozturk.py
@@ -0,0 +1,9 @@
1
+import asyncio
2
+
3
+def awaitme(func):
4
+ async def wrapped(*a, **kw):
5
+ if asyncio.iscoroutinefunction(func):
6
+ return await func(*a, **kw)
7
+ loop = asyncio.get_event_loop()
8
+ return await loop.run_in_executor(None, func, *a)
9
+ return wrapped
0 commit comments