📝 refine async state type docs

This commit is contained in:
Nanaloveyuki
2026-06-14 01:53:12 +08:00
parent f824cbfa68
commit e776455861
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -54,6 +54,7 @@ Detailed rules explaining key parameters and behaviors
- `AsyncLogger::state()` is the higher-level API that reads these values from a concrete logger.
- It also does not validate whether the supplied fields represent a combination that could come from one real logger instant.
- The constructed value matches the same public shape used by async logger serializers.
- Because `AsyncLoggerState` is only a data snapshot type, this constructor is mainly useful for tests, adapters, and synthetic diagnostics rather than ordinary logger inspection.
### How to Use
+1
View File
@@ -34,6 +34,7 @@ Detailed rules explaining key parameters and behaviors
- The remaining fields capture queue counts, lifecycle status, failure state, last error text, and active flush policy.
- `AsyncLogger::state()` returns this type directly, while `async_logger_state_to_json(...)` and `stringify_async_logger_state(...)` export the same data shape for diagnostics.
- `AsyncLogger::state()` currently builds this snapshot from `async_runtime_state()` plus the logger's current counters, lifecycle flags, last error, and flush policy.
- `AsyncLoggerState::new(...)` can also construct this type manually, but manual construction is synthetic snapshot data and does not read one live logger instant by itself.
### How to Use
+1
View File
@@ -42,6 +42,7 @@ Detailed rules explaining key parameters and behaviors
- `async_runtime_state()` is the higher-level API that reads these values from the live runtime environment.
- It also does not validate whether the supplied pair matches the current backend contract.
- The constructed value matches the same public shape used by async runtime serializers.
- Because `AsyncRuntimeState` is only a data snapshot type, this constructor is mainly useful for tests, adapters, and synthetic diagnostics rather than ordinary runtime probing.
### How to Use
+1
View File
@@ -34,6 +34,7 @@ Detailed rules explaining key parameters and behaviors
- `async_runtime_state()` returns this type directly as an environment-level snapshot.
- `async_runtime_state()` currently builds that snapshot from `async_runtime_mode()` and `async_runtime_supports_background_worker()`.
- `async_runtime_state_to_json(...)` and `stringify_async_runtime_state(...)` serialize the same snapshot shape for diagnostics.
- `AsyncRuntimeState::new(...)` can also construct this type manually, but manual construction is synthetic data and does not probe the current backend by itself.
### How to Use