mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-31 23:44:39 +00:00
📝 refine async runtime helper docs
This commit is contained in:
@@ -36,6 +36,7 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
- The returned value is intended for diagnostics and stable output, not just debugging prints.
|
- The returned value is intended for diagnostics and stable output, not just debugging prints.
|
||||||
- It keeps mode serialization logic in one place.
|
- It keeps mode serialization logic in one place.
|
||||||
- This helper is used by async runtime JSON helpers.
|
- This helper is used by async runtime JSON helpers.
|
||||||
|
- `async_runtime_state_to_json(...)` serializes the `mode` field through this helper, so runtime snapshots and direct label rendering share the same canonical text.
|
||||||
- Labels are more stable for telemetry and docs than ad hoc manual matching at call sites.
|
- Labels are more stable for telemetry and docs than ad hoc manual matching at call sites.
|
||||||
- The current canonical labels are exactly `native_worker` for `NativeWorker` and `compatibility` for `Compatibility`.
|
- The current canonical labels are exactly `native_worker` for `NativeWorker` and `compatibility` for `Compatibility`.
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
- `async_runtime_supports_background_worker()` is a narrower boolean probe built on the same idea.
|
- `async_runtime_supports_background_worker()` is a narrower boolean probe built on the same idea.
|
||||||
- `async_runtime_state()` packages this mode together with the current background-worker capability into one `AsyncRuntimeState` snapshot.
|
- `async_runtime_state()` packages this mode together with the current background-worker capability into one `AsyncRuntimeState` snapshot.
|
||||||
- In the current backend implementations, `NativeWorker` pairs with `background_worker=true` and `Compatibility` pairs with `background_worker=false`.
|
- In the current backend implementations, `NativeWorker` pairs with `background_worker=true` and `Compatibility` pairs with `background_worker=false`.
|
||||||
|
- Concretely, the native runtime entrypoint returns `native_worker_async_runtime_mode()`, while the compatibility stub returns `compatibility_async_runtime_mode()`.
|
||||||
- This API is intentionally small and useful for lightweight branching.
|
- This API is intentionally small and useful for lightweight branching.
|
||||||
- The mode result describes runtime behavior only; it should not be read as proof that every backend has been equally re-verified in the current release cycle.
|
- The mode result describes runtime behavior only; it should not be read as proof that every backend has been equally re-verified in the current release cycle.
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
- `true` indicates native worker capability.
|
- `true` indicates native worker capability.
|
||||||
- `false` indicates compatibility-mode behavior.
|
- `false` indicates compatibility-mode behavior.
|
||||||
- This helper is derived from backend-specific async runtime implementation choice.
|
- This helper is derived from backend-specific async runtime implementation choice.
|
||||||
|
- In the current backend split, the native implementation returns `true` while the compatibility stub returns `false`, matching the same mode pair exposed through `async_runtime_mode()` and `async_runtime_state()`.
|
||||||
- The async library still targets multiple backends even when this helper returns `false`.
|
- The async library still targets multiple backends even when this helper returns `false`.
|
||||||
- Use it when an enum branch is unnecessary and a boolean capability check is enough.
|
- Use it when an enum branch is unnecessary and a boolean capability check is enough.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user