📝 align async state serializer docs

This commit is contained in:
Nanaloveyuki
2026-06-14 07:06:16 +08:00
parent a2b37dfe53
commit 1f3da3e6ba
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -40,6 +40,7 @@ Detailed rules explaining key parameters and behaviors
- This helper is suitable for health endpoints, diagnostics payloads, and custom serialization flows.
- It shares the same stable field names used by `stringify_async_logger_state(...)`.
- The state must already have been captured or constructed before serialization.
- Serialization preserves whatever snapshot combination it receives, including failure flags together with remaining backlog counts.
### How to Use
@@ -71,6 +72,8 @@ e.g.:
- If the queue is empty, `pending_count` and `dropped_count` are still serialized normally as numeric values.
- If `has_failed` is `true`, serialization does not force `pending_count` to `0` or clear `last_error`; it reports the snapshot exactly as provided.
### Notes
1. This helper preserves the nested runtime snapshot instead of flattening `mode` and `background_worker` onto the top level.