mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-30 15:04:48 +00:00
📝 clarify async runtime json snapshot semantics
This commit is contained in:
@@ -38,6 +38,8 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
- The compact serialized shape is `{"mode":"native_worker|compatibility","background_worker":true|false}`.
|
- The compact serialized shape is `{"mode":"native_worker|compatibility","background_worker":true|false}`.
|
||||||
- This helper focuses on runtime capabilities rather than queue counters or logger lifecycle flags.
|
- This helper focuses on runtime capabilities rather than queue counters or logger lifecycle flags.
|
||||||
- The exported JSON is suitable for diagnostics endpoints and startup environment checks.
|
- The exported JSON is suitable for diagnostics endpoints and startup environment checks.
|
||||||
|
- This helper serializes the provided `AsyncRuntimeState` exactly as given; it does not call `async_runtime_state()` or recheck backend capability by itself.
|
||||||
|
- That means manually constructed runtime snapshots are exported unchanged, with `mode` relabeled through `async_runtime_mode_label(...)` and `background_worker` kept exactly as supplied.
|
||||||
|
|
||||||
### How to Use
|
### How to Use
|
||||||
|
|
||||||
@@ -68,6 +70,8 @@ e.g.:
|
|||||||
|
|
||||||
- If the runtime is in compatibility mode, the helper still serializes normally using the matching mode label.
|
- If the runtime is in compatibility mode, the helper still serializes normally using the matching mode label.
|
||||||
|
|
||||||
|
- If callers need the current backend-derived runtime rather than an older or synthetic snapshot, they must capture a fresh `async_runtime_state()` first.
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
|
|
||||||
1. The output field names are fixed as `mode` and `background_worker`.
|
1. The output field names are fixed as `mode` and `background_worker`.
|
||||||
|
|||||||
Reference in New Issue
Block a user