You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apps/creating-apps.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,8 @@ Apps can also declare **services** — background components that run at boot ti
88
88
"classname": "MyBootService",
89
89
"intent_filters": [
90
90
{
91
-
"action": "boot_completed"
91
+
"action": "boot_completed",
92
+
"delay_s": 120
92
93
}
93
94
]
94
95
}
@@ -101,7 +102,7 @@ Each service entry has:
101
102
|-------|-------------|
102
103
|`entrypoint`| Path to the Python file (relative to the app root) |
103
104
|`classname`| Name of the `Service` subclass in that file |
104
-
|`intent_filters`| Array of `{ "action": "..."}` objects. Use `"boot_completed"` to run at startup |
105
+
|`intent_filters`| Array of `{ "action": "...", "delay_s": N }` objects. Use `"boot_completed"` to run at startup. Optional `delay_s` (seconds) defers the import and start of the service; `0` or absent starts immediately|
105
106
106
107
Services that subscribe to `"boot_completed"` are started automatically during system boot, after the launcher is displayed. See the [Service documentation](../frameworks/service.md) for details on writing and using services.
Copy file name to clipboardExpand all lines: docs/architecture/boot-sequence.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,10 @@ MicroPythonOS consists of several core components that initialize and manage the
19
19
-`WifiBootService` — auto-connects WiFi in a background thread
20
20
-`WebServerBootService` — starts the HTTP web server
21
21
-`AIOReplService` — starts the asyncio REPL task
22
-
- App-specific services (e.g., `OSUpdateService`)
22
+
- App-specific services with `delay_s: 0` or no delay (e.g., `NostrBootService`, `MeshCoreBootService`)
23
+
- Schedules **deferred boot services** — services declaring `delay_s` > 0 in their intent_filter are imported and started asynchronously after the delay, keeping non-critical module imports out of the boot path:
24
+
-`AppStoreService` (120s delay)
25
+
-`OSUpdateService` (90s delay)
23
26
- Marks the current boot as successful (cancel rollback)
Copy file name to clipboardExpand all lines: docs/frameworks/service.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ Apps declare services in their `MANIFEST.JSON` under a `"services"` array:
125
125
"entrypoint": "osupdate_boot_service.py",
126
126
"classname": "OSUpdateService",
127
127
"intent_filters": [
128
-
{ "action": "boot_completed" }
128
+
{ "action": "boot_completed", "delay_s": 90 }
129
129
]
130
130
}
131
131
]
@@ -138,7 +138,7 @@ Each service entry requires:
138
138
|-------|-------------|
139
139
|`entrypoint`| Path to the Python file (relative to the app root) |
140
140
|`classname`| Name of the Service subclass in that file |
141
-
|`intent_filters`| Array of `{ "action": "..."}` objects. `"boot_completed"` triggers the service at startup |
141
+
|`intent_filters`| Array of `{ "action": "...", "delay_s": N }` objects. `"boot_completed"` triggers the service at startup. Optional `delay_s` (seconds) defers the import and start of the service; `0` or absent starts immediately|
0 commit comments