📝 refine async snapshot docs

This commit is contained in:
Nanaloveyuki
2026-06-14 01:59:27 +08:00
parent e13ea2209a
commit 91b0900b11
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -38,6 +38,7 @@ Detailed rules explaining key parameters and behaviors
- This helper is equivalent to `AsyncLoggerState::new(async_runtime_state(), self.pending_count(), self.dropped_count(), self.is_closed(), self.is_running(), self.has_failed(), self.last_error(), self.flush_policy())`.
- `async_logger_state_to_json(...)` and `stringify_async_logger_state(...)` convert the snapshot to stable diagnostic output.
- `runtime` embeds the result of `async_runtime_state()` so callers do not need to join separate helpers manually.
- Because the snapshot is assembled field by field when `state()` is called, later logger changes require calling `state()` again rather than reusing an older `AsyncLoggerState` value as if it refreshed itself.
### How to Use
+1
View File
@@ -39,6 +39,7 @@ Detailed rules explaining key parameters and behaviors
- In the current backend implementations, the resulting pair is `NativeWorker + true` or `Compatibility + false`.
- `async_runtime_state_to_json(...)` and `stringify_async_runtime_state(...)` serialize this state.
- This API is environment-scoped and does not depend on a particular `AsyncLogger` instance.
- The returned value is a snapshot data object, not a live runtime handle, so later backend checks require calling `async_runtime_state()` again rather than reusing an older value as if it refreshed itself.
### How to Use