oocana-python-executor 0.16.7__tar.gz → 0.16.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/PKG-INFO +1 -1
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/pyproject.toml +1 -1
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/executor.py +1 -1
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/utils.py +7 -7
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/__init__.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/block.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/context.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/data.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/hook.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/logger.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/matplot/matplotlib_oomol/__init__.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/matplot/matplotlib_oomol/oomol.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/matplot/oomol_matplot_helper.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/secret.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/service.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/python_executor/topic.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/tests/test_cli.py +0 -0
- {oocana_python_executor-0.16.7 → oocana_python_executor-0.16.9}/tests/test_secret.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: oocana-python-executor
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.9
|
|
4
4
|
Summary: a client subscribe mqtt topic to execute oocana's block
|
|
5
5
|
Author-Email: l1shen <lishen1635@gmail.com>, yleaf <11785335+leavesster@users.noreply.github.com>
|
|
6
6
|
License: MIT
|
|
@@ -203,7 +203,7 @@ async def run_executor(address: str, session_id: str, tmp_dir: str, package: str
|
|
|
203
203
|
mainframe.publish(run_action_topic(params), message)
|
|
204
204
|
|
|
205
205
|
while True:
|
|
206
|
-
await asyncio.sleep(1)
|
|
206
|
+
await asyncio.sleep(0.1) # Avoid busy waiting
|
|
207
207
|
if not fs.empty():
|
|
208
208
|
f = fs.get()
|
|
209
209
|
message = await f
|
|
@@ -2,14 +2,14 @@ import threading
|
|
|
2
2
|
import asyncio
|
|
3
3
|
from typing import Callable, Awaitable, Any
|
|
4
4
|
|
|
5
|
-
def run_async_code(async_func):
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
def run_async_code(async_func: Awaitable[Any]):
|
|
6
|
+
async def wrapper():
|
|
7
|
+
await async_func
|
|
8
|
+
pending = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
|
|
9
|
+
if pending:
|
|
10
|
+
await asyncio.gather(*pending)
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
loop.run_until_complete(async_func)
|
|
11
|
-
finally:
|
|
12
|
-
loop.close()
|
|
12
|
+
asyncio.run(wrapper())
|
|
13
13
|
|
|
14
14
|
def run_async_code_and_loop(async_func):
|
|
15
15
|
loop = asyncio.new_event_loop()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|