pyloid 0.23.3__py3-none-any.whl → 0.23.4__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.
- pyloid/__init__.py +1 -1
- pyloid/rpc.py +25 -1
- {pyloid-0.23.3.dist-info → pyloid-0.23.4.dist-info}/METADATA +1 -1
- {pyloid-0.23.3.dist-info → pyloid-0.23.4.dist-info}/RECORD +6 -6
- {pyloid-0.23.3.dist-info → pyloid-0.23.4.dist-info}/LICENSE +0 -0
- {pyloid-0.23.3.dist-info → pyloid-0.23.4.dist-info}/WHEEL +0 -0
pyloid/__init__.py
CHANGED
pyloid/rpc.py
CHANGED
@@ -87,6 +87,18 @@ class PyloidRPC:
|
|
87
87
|
def __init__(self):
|
88
88
|
"""
|
89
89
|
Initialize the PyloidRPC server instance.
|
90
|
+
|
91
|
+
Examples
|
92
|
+
--------
|
93
|
+
```python
|
94
|
+
from pyloid.rpc import PyloidRPC
|
95
|
+
|
96
|
+
rpc = PyloidRPC()
|
97
|
+
|
98
|
+
@rpc.method()
|
99
|
+
async def add(a: int, b: int) -> int:
|
100
|
+
return a + b
|
101
|
+
```
|
90
102
|
"""
|
91
103
|
self._host = "127.0.0.1"
|
92
104
|
self._port = get_free_port()
|
@@ -115,7 +127,7 @@ class PyloidRPC:
|
|
115
127
|
self._runner: Optional[web.AppRunner] = None
|
116
128
|
self._site: Optional[web.TCPSite] = None
|
117
129
|
|
118
|
-
def
|
130
|
+
def method(self, name: Optional[str] = None) -> Callable:
|
119
131
|
"""
|
120
132
|
Decorator to register an async function as an RPC method.
|
121
133
|
|
@@ -136,6 +148,18 @@ class PyloidRPC:
|
|
136
148
|
If the decorated function is not an async function (`coroutinefunction`).
|
137
149
|
ValueError
|
138
150
|
If an RPC function with the specified name is already registered.
|
151
|
+
|
152
|
+
Examples
|
153
|
+
--------
|
154
|
+
```python
|
155
|
+
from pyloid.rpc import PyloidRPC
|
156
|
+
|
157
|
+
rpc = PyloidRPC()
|
158
|
+
|
159
|
+
@rpc.method()
|
160
|
+
async def add(a: int, b: int) -> int:
|
161
|
+
return a + b
|
162
|
+
```
|
139
163
|
"""
|
140
164
|
def decorator(func: Callable[..., Coroutine[Any, Any, Any]]):
|
141
165
|
rpc_name = name or func.__name__
|
@@ -1,4 +1,4 @@
|
|
1
|
-
pyloid/__init__.py,sha256=
|
1
|
+
pyloid/__init__.py,sha256=YKwMCSOds1QVi9N7EGfY0Z7BEjJn8j6HGqRblZlZClA,235
|
2
2
|
pyloid/api.py,sha256=A61Kmddh8BlpT3LfA6NbPQNzFmD95vQ4WKX53oKsGYU,2419
|
3
3
|
pyloid/autostart.py,sha256=K7DQYl4LHItvPp0bt1V9WwaaZmVSTeGvadkcwG-KKrI,3899
|
4
4
|
pyloid/browser_window.py,sha256=XCbFjVNdc5SfsvGeo1M6roC-9P6CG7gp6nAbNXvaKWE,99716
|
@@ -9,7 +9,7 @@ pyloid/js_api/event_api.py,sha256=w0z1DcmwcmseqfcoZWgsQmFC2iBCgTMVJubTaHeXI1c,95
|
|
9
9
|
pyloid/js_api/window_api.py,sha256=-isphU3m2wGB5U0yZrSuK_4XiBz2mG45HsjYTUq7Fxs,7348
|
10
10
|
pyloid/monitor.py,sha256=1mXvHm5deohnNlTLcRx4sT4x-stnOIb0dUQnnxN50Uo,28295
|
11
11
|
pyloid/pyloid.py,sha256=bsD5KgEIK1uApJQHkobljlY8wBkCTCiebV2mVE6MudM,85566
|
12
|
-
pyloid/rpc.py,sha256=
|
12
|
+
pyloid/rpc.py,sha256=V7iPdKPHpsG6LOgXTSIshYTR-dkLXWHoQchB_7DvwKY,15648
|
13
13
|
pyloid/serve.py,sha256=wJIBqiLr1-8FvBdV3yybeBtVXsu94FfWYKjHL0eQ68s,1444
|
14
14
|
pyloid/store.py,sha256=p0plJj52hQjjtNMVJhy20eNLXfQ3Qmf7LtGHQk7FiPg,4471
|
15
15
|
pyloid/thread_pool.py,sha256=fKOBb8jMfZn_7crA_fJCno8dObBRZE31EIWaNQ759aw,14616
|
@@ -17,7 +17,7 @@ pyloid/timer.py,sha256=RqMsChFUd93cxMVgkHWiIKrci0QDTBgJSTULnAtYT8M,8712
|
|
17
17
|
pyloid/tray.py,sha256=D12opVEc2wc2T4tK9epaN1oOdeziScsIVNM2uCN7C-A,1710
|
18
18
|
pyloid/url_interceptor.py,sha256=AFjPANDELc9-E-1TnVvkNVc-JZBJYf0677dWQ8LDaqw,726
|
19
19
|
pyloid/utils.py,sha256=e866N9uyAGHTMYsqRYY4JL0AEMRCOiY-k1c1zmEpDA4,4686
|
20
|
-
pyloid-0.23.
|
21
|
-
pyloid-0.23.
|
22
|
-
pyloid-0.23.
|
23
|
-
pyloid-0.23.
|
20
|
+
pyloid-0.23.4.dist-info/LICENSE,sha256=F96EzotgWhhpnQTW2TcdoqrMDir1jyEo6H915tGQ-QE,11524
|
21
|
+
pyloid-0.23.4.dist-info/METADATA,sha256=-OMATAdutjloQhPgh_VbNLxANrO48qUFzEJaFmRehAg,3197
|
22
|
+
pyloid-0.23.4.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
23
|
+
pyloid-0.23.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|