diff sat/plugins/plugin_app_manager_docker/__init__.py @ 3998:402d31527af4

plugin app manager: `start` doesn't wait anymore for actual app start: Application may be long to start (e.g. a Docker app may have to download images first, and even without the downloading, the starting could be long), which may lead to UI blocking or bridge time out. To prevent that, `start` is now returning immediately, and 2 new signals are used to indicate when the application is started, of if something wrong happened. `start` now returns initial app data, including exposed data without the computed exposed data. The computed data must be retrieved after the app has been started.
author Goffi <goffi@goffi.org>
date Sat, 04 Mar 2023 18:30:47 +0100
parents be6d91572633
children
line wrap: on
line diff
--- a/sat/plugins/plugin_app_manager_docker/__init__.py	Sat Mar 04 18:23:33 2023 +0100
+++ b/sat/plugins/plugin_app_manager_docker/__init__.py	Sat Mar 04 18:30:47 2023 +0100
@@ -57,7 +57,7 @@
         self._am.register(self)
 
     async def start(self, app_data: dict) -> None:
-        await self._am.startCommon(app_data)
+        await self._am.start_common(app_data)
         working_dir = app_data['_instance_dir_path']
         try:
             override = app_data['override']
@@ -83,7 +83,7 @@
             path=str(working_dir),
         )
 
-    async def computeExpose(self, app_data: dict) -> dict:
+    async def compute_expose(self, app_data: dict) -> dict:
         working_dir = app_data['_instance_dir_path']
         expose = app_data['expose']
         ports = expose.get('ports', {})