orionis 0.187.0__py3-none-any.whl → 0.188.0__py3-none-any.whl
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.
- orionis/framework.py +1 -1
- orionis/luminate/support/asyn_run.py +23 -7
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/METADATA +1 -1
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/RECORD +8 -8
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/LICENCE +0 -0
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/WHEEL +0 -0
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.187.0.dist-info → orionis-0.188.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
@@ -1,22 +1,38 @@
|
|
1
1
|
import asyncio
|
2
|
-
from typing import Any,
|
2
|
+
from typing import Any, Coroutine, TypeVar
|
3
|
+
|
4
|
+
T = TypeVar("T")
|
3
5
|
|
4
6
|
class AsyncExecutor:
|
7
|
+
""" Utility class to run asynchronous functions synchronously. """
|
5
8
|
|
6
9
|
@staticmethod
|
7
|
-
def run(callback:
|
10
|
+
def run(callback: Coroutine[Any, Any, T]) -> T:
|
8
11
|
"""
|
9
|
-
Runs
|
12
|
+
Runs an asynchronous coroutine in a synchronous context.
|
10
13
|
|
11
14
|
Parameters
|
12
15
|
----------
|
13
|
-
callback :
|
14
|
-
The coroutine to
|
16
|
+
callback : Coroutine[Any, Any, T]
|
17
|
+
The asynchronous coroutine to execute.
|
18
|
+
|
19
|
+
Returns
|
20
|
+
-------
|
21
|
+
T
|
22
|
+
The result of the coroutine execution.
|
23
|
+
|
24
|
+
Raises
|
25
|
+
------
|
26
|
+
Exception
|
27
|
+
If the coroutine execution fails.
|
15
28
|
"""
|
16
29
|
try:
|
17
30
|
loop = asyncio.get_running_loop()
|
18
|
-
return loop.run_until_complete(callback())
|
19
31
|
except RuntimeError:
|
20
32
|
loop = asyncio.new_event_loop()
|
21
33
|
asyncio.set_event_loop(loop)
|
22
|
-
|
34
|
+
|
35
|
+
try:
|
36
|
+
return loop.run_until_complete(callback)
|
37
|
+
except Exception as e:
|
38
|
+
raise RuntimeError(f"Error executing coroutine: {e}") from e
|
@@ -1,6 +1,6 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/console.py,sha256=4gYWxf0fWYgJ4RKwARvnTPh06FL3GJ6SAZ7R2NzOICw,1342
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=b3mhxwluRhkBPTlJOKAyvRghS2XaX2vP5DlQYMbSorw,1469
|
4
4
|
orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
orionis/installer/manager.py,sha256=SYP-k_3c2oxFOCCWfMz-wnekWivn3VcFVMUU5e_sJYo,2787
|
6
6
|
orionis/installer/output.py,sha256=7O9qa2xtXMB_4ZvVi-Klneom9YazwygAd_4uYAoxhbU,8548
|
@@ -159,7 +159,7 @@ orionis/luminate/services/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
159
159
|
orionis/luminate/services/files/path_resolver_service.py,sha256=gCGVLtdXGuEIE6I8tm6JEB84HS1Fa5rk2whO2R6u8Wc,1698
|
160
160
|
orionis/luminate/services/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
161
161
|
orionis/luminate/services/log/log_service.py,sha256=7KZ9i5RGquUqRADTa7T61v4kTu_qjDOVyaoGvm_51f0,8291
|
162
|
-
orionis/luminate/support/asyn_run.py,sha256=
|
162
|
+
orionis/luminate/support/asyn_run.py,sha256=daqoV7eRb_6MWMq_ALVlbO20vfXedBrvKDYV-LqGyiI,1032
|
163
163
|
orionis/luminate/support/dot_dict.py,sha256=FVHfBuAGTTVMjNG01Fix645fRNKKUMmNx61pYkxPL5c,1253
|
164
164
|
orionis/luminate/support/exception_to_dict.py,sha256=OV3vWZ6Dlh3EnFurR_7zhR3mfXDZg-UFbMsfs4tNnLA,2105
|
165
165
|
orionis/luminate/support/reflection.py,sha256=TbWZ_cer0PXrPlwCYFbUJRymlzYxXT0E4C5XCsSc3mw,11951
|
@@ -180,9 +180,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
180
180
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
181
181
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
182
182
|
tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
|
183
|
-
orionis-0.
|
184
|
-
orionis-0.
|
185
|
-
orionis-0.
|
186
|
-
orionis-0.
|
187
|
-
orionis-0.
|
188
|
-
orionis-0.
|
183
|
+
orionis-0.188.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
184
|
+
orionis-0.188.0.dist-info/METADATA,sha256=t7GdtgFO0YUmT6SPMLFjV0nL-YrkZShRooWxUOYEUoc,3003
|
185
|
+
orionis-0.188.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
186
|
+
orionis-0.188.0.dist-info/entry_points.txt,sha256=a_e0faeSqyUCVZd0MqljQ2oaHHdlsz6g9sU_bMqi5zQ,49
|
187
|
+
orionis-0.188.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
188
|
+
orionis-0.188.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|