From 91b0900b11f3b11acb9ec79989fa80eee72cedee Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Sun, 14 Jun 2026 01:59:27 +0800 Subject: [PATCH] :memo: refine async snapshot docs --- docs/api/async-logger-state.md | 1 + docs/api/async-runtime-state.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/api/async-logger-state.md b/docs/api/async-logger-state.md index 7ff3697..5c9a63b 100644 --- a/docs/api/async-logger-state.md +++ b/docs/api/async-logger-state.md @@ -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 diff --git a/docs/api/async-runtime-state.md b/docs/api/async-runtime-state.md index ceadee7..cf19b55 100644 --- a/docs/api/async-runtime-state.md +++ b/docs/api/async-runtime-state.md @@ -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