reyserver 1.1.62__py3-none-any.whl → 1.1.63__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.
Potentially problematic release.
This version of reyserver might be problematic. Click here for more details.
- reyserver/rserver.py +37 -3
- {reyserver-1.1.62.dist-info → reyserver-1.1.63.dist-info}/METADATA +1 -1
- {reyserver-1.1.62.dist-info → reyserver-1.1.63.dist-info}/RECORD +5 -5
- {reyserver-1.1.62.dist-info → reyserver-1.1.63.dist-info}/WHEEL +0 -0
- {reyserver-1.1.62.dist-info → reyserver-1.1.63.dist-info}/licenses/LICENSE +0 -0
reyserver/rserver.py
CHANGED
|
@@ -216,16 +216,50 @@ class Server(ServerBase, Singleton):
|
|
|
216
216
|
return response
|
|
217
217
|
|
|
218
218
|
|
|
219
|
-
def run(
|
|
219
|
+
def run(
|
|
220
|
+
self,
|
|
221
|
+
host: str = '127.0.0.1',
|
|
222
|
+
port: int = 1024,
|
|
223
|
+
app: str | None = None,
|
|
224
|
+
workers: int = 1
|
|
225
|
+
) -> None:
|
|
220
226
|
"""
|
|
221
227
|
Run server.
|
|
228
|
+
|
|
229
|
+
Parameters
|
|
230
|
+
----------
|
|
231
|
+
host : Server host.
|
|
232
|
+
port: Server port.
|
|
233
|
+
app : Application path, format is `Module[.Sub....]:Variable[.Attributre....]` (e.g. `module.sub:server.app`).
|
|
234
|
+
- `None`: Cannot use parameter `workers`.
|
|
235
|
+
workers: Number of server work processes.
|
|
236
|
+
|
|
237
|
+
Examples
|
|
238
|
+
--------
|
|
239
|
+
>>> server = Server(db)
|
|
240
|
+
|
|
241
|
+
Single work process.
|
|
242
|
+
>>> server.run()
|
|
243
|
+
|
|
244
|
+
Multiple work processes.
|
|
245
|
+
>>> server = Server(db)
|
|
246
|
+
>>> if __name__ == '__main__':
|
|
247
|
+
>>> server('module.sub:server.app')
|
|
222
248
|
"""
|
|
223
249
|
|
|
250
|
+
# Parameter.
|
|
251
|
+
if app is None:
|
|
252
|
+
app = self.app
|
|
253
|
+
|
|
224
254
|
# Run.
|
|
225
255
|
uvicorn_run(
|
|
226
|
-
|
|
256
|
+
app,
|
|
257
|
+
host=host,
|
|
258
|
+
port=port,
|
|
259
|
+
workers=workers,
|
|
227
260
|
ssl_certfile=self.ssl_cert,
|
|
228
|
-
ssl_keyfile=self.ssl_key
|
|
261
|
+
ssl_keyfile=self.ssl_key,
|
|
262
|
+
# factory=True
|
|
229
263
|
)
|
|
230
264
|
|
|
231
265
|
|
|
@@ -4,8 +4,8 @@ reyserver/rauth.py,sha256=JGo5lLTRGoP1SFPyQA-Q5EE-O3OU_86Mb3pvwhvFu-w,15125
|
|
|
4
4
|
reyserver/rbase.py,sha256=0ECJ1zuUpJhwaNc0u5GvR5VyGxIAnKQep-EdotwnLoE,7752
|
|
5
5
|
reyserver/rclient.py,sha256=og5YuWm-PODkFn9njBwYQpGlk0j1BfqFuEarlCFSQYI,6229
|
|
6
6
|
reyserver/rfile.py,sha256=6H5_7B9aiA3F56VToQDI9Trarkrl9gcIuFqYyCVCiCU,8877
|
|
7
|
-
reyserver/rserver.py,sha256=
|
|
8
|
-
reyserver-1.1.
|
|
9
|
-
reyserver-1.1.
|
|
10
|
-
reyserver-1.1.
|
|
11
|
-
reyserver-1.1.
|
|
7
|
+
reyserver/rserver.py,sha256=sSFoWTnsSRBJ9SZT5i6yzMzDnwg0_YFbSUI7e_8QfiA,10465
|
|
8
|
+
reyserver-1.1.63.dist-info/METADATA,sha256=de-VXiY3vj5atn-pdBUX0zz6FFg_7hWVJV_JEABCnTw,1666
|
|
9
|
+
reyserver-1.1.63.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
+
reyserver-1.1.63.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
|
11
|
+
reyserver-1.1.63.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|