reyserver 1.1.62__py3-none-any.whl → 1.1.64__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 +39 -3
- {reyserver-1.1.62.dist-info → reyserver-1.1.64.dist-info}/METADATA +1 -1
- {reyserver-1.1.62.dist-info → reyserver-1.1.64.dist-info}/RECORD +5 -5
- {reyserver-1.1.62.dist-info → reyserver-1.1.64.dist-info}/WHEEL +0 -0
- {reyserver-1.1.62.dist-info → reyserver-1.1.64.dist-info}/licenses/LICENSE +0 -0
reyserver/rserver.py
CHANGED
|
@@ -216,16 +216,52 @@ 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
|
+
factory: bool = False,
|
|
225
|
+
workers: int = 1
|
|
226
|
+
) -> None:
|
|
220
227
|
"""
|
|
221
228
|
Run server.
|
|
229
|
+
|
|
230
|
+
Parameters
|
|
231
|
+
----------
|
|
232
|
+
host : Server host.
|
|
233
|
+
port: Server port.
|
|
234
|
+
app : Application path, format is `Module[.Sub....]:Variable[.Attributre....]` (e.g. `module.sub:server.app`).
|
|
235
|
+
- `None`: Cannot use parameter `workers`.
|
|
236
|
+
factory : Whether parameter `app` is factory function.
|
|
237
|
+
workers: Number of server work processes.
|
|
238
|
+
|
|
239
|
+
Examples
|
|
240
|
+
--------
|
|
241
|
+
>>> server = Server(db)
|
|
242
|
+
|
|
243
|
+
Single work process.
|
|
244
|
+
>>> server.run()
|
|
245
|
+
|
|
246
|
+
Multiple work processes.
|
|
247
|
+
>>> server = Server(db)
|
|
248
|
+
>>> if __name__ == '__main__':
|
|
249
|
+
>>> server('module.sub:server.app')
|
|
222
250
|
"""
|
|
223
251
|
|
|
252
|
+
# Parameter.
|
|
253
|
+
if app is None:
|
|
254
|
+
app = self.app
|
|
255
|
+
|
|
224
256
|
# Run.
|
|
225
257
|
uvicorn_run(
|
|
226
|
-
|
|
258
|
+
app,
|
|
259
|
+
host=host,
|
|
260
|
+
port=port,
|
|
261
|
+
workers=workers,
|
|
227
262
|
ssl_certfile=self.ssl_cert,
|
|
228
|
-
ssl_keyfile=self.ssl_key
|
|
263
|
+
ssl_keyfile=self.ssl_key,
|
|
264
|
+
factory=factory
|
|
229
265
|
)
|
|
230
266
|
|
|
231
267
|
|
|
@@ -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=fCuf8pDBM2ZdAOlXPzlFcNf63zUGjoTY3VKLoXjNqpo,10562
|
|
8
|
+
reyserver-1.1.64.dist-info/METADATA,sha256=WhmSK0M15RiZXyO2e8fxsvScBmkfcZXOKBi24u-Hodo,1666
|
|
9
|
+
reyserver-1.1.64.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
+
reyserver-1.1.64.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
|
11
|
+
reyserver-1.1.64.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|