tigrcorn-runtime 0.3.18.dev3__py3-none-any.whl → 0.3.20.dev1__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.
tigrcorn_runtime/api.py CHANGED
@@ -283,7 +283,18 @@ def run(
283
283
  None.
284
284
  """
285
285
 
286
- runtime = config.process.runtime if config is not None else 'auto'
286
+ if config is not None and config.process.workers > 1:
287
+ if not isinstance(app, str):
288
+ raise ValueError(
289
+ "multiple workers require an importable application target"
290
+ )
291
+ from tigrcorn_runtime.server.supervisor import ServerSupervisor
292
+
293
+ config.app.target = app
294
+ config.app.factory = config.app.factory or factory
295
+ ServerSupervisor(app_target=app, config=config).run()
296
+ return
297
+ runtime = config.process.runtime if config is not None else "auto"
287
298
  if isinstance(app, str):
288
299
  run_coro_with_runtime(
289
300
  lambda: serve_import_string(