mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-31 07:24:31 +00:00
📝 fix async alias examples
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
name: application-async-logger
|
name: application-async-logger
|
||||||
group: api
|
group: api
|
||||||
category: facade
|
category: facade
|
||||||
update-time: 20260613
|
update-time: 20260614
|
||||||
description: Application-facing alias for the runtime-sink async logger surface.
|
description: Application-facing alias for the runtime-sink async logger surface, preserving the same async calling semantics as AsyncLogger.
|
||||||
key-word:
|
key-word:
|
||||||
- application
|
- application
|
||||||
- async
|
- async
|
||||||
@@ -31,6 +31,7 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
|
|
||||||
- This alias does not introduce a new runtime type or wrapper layer.
|
- This alias does not introduce a new runtime type or wrapper layer.
|
||||||
- It preserves the same async lifecycle helpers such as `run()`, `shutdown()`, `pending_count()`, and `state()`.
|
- It preserves the same async lifecycle helpers such as `run()`, `shutdown()`, `pending_count()`, and `state()`.
|
||||||
|
- Because this is only an alias, methods that are async on `AsyncLogger[@bitlogger.RuntimeSink]` remain async here as well.
|
||||||
- The alias exists to give application boot code a clearer public type name for the standard runtime-sink async logger.
|
- The alias exists to give application boot code a clearer public type name for the standard runtime-sink async logger.
|
||||||
- Builders such as `build_application_async_logger(...)` and `parse_and_build_application_async_logger(...)` return this alias.
|
- Builders such as `build_application_async_logger(...)` and `parse_and_build_application_async_logger(...)` return this alias.
|
||||||
|
|
||||||
@@ -53,12 +54,12 @@ In this example, the application alias keeps the same underlying async logger be
|
|||||||
|
|
||||||
When top-level boot code or services should expose an application-oriented async logger type:
|
When top-level boot code or services should expose an application-oriented async logger type:
|
||||||
```moonbit
|
```moonbit
|
||||||
fn start_async(logger : ApplicationAsyncLogger) -> Unit {
|
async fn start_async(logger : ApplicationAsyncLogger) -> Unit {
|
||||||
logger.run()
|
logger.run()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, callers see the app-facing alias instead of the more explicit generic async logger spelling.
|
In this example, callers see the app-facing alias instead of the more explicit generic async logger spelling, while `run()` keeps its async calling contract.
|
||||||
|
|
||||||
### Error Case
|
### Error Case
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
name: application-text-async-logger
|
name: application-text-async-logger
|
||||||
group: api
|
group: api
|
||||||
category: facade
|
category: facade
|
||||||
update-time: 20260613
|
update-time: 20260614
|
||||||
description: Application-facing alias for the text-console async logger surface.
|
description: Application-facing alias for the text-console async logger surface, preserving the same async calling semantics as AsyncLogger.
|
||||||
key-word:
|
key-word:
|
||||||
- application
|
- application
|
||||||
- async
|
- async
|
||||||
@@ -31,6 +31,7 @@ Detailed rules explaining key parameters and behaviors
|
|||||||
|
|
||||||
- This alias does not introduce a new runtime type or wrapper layer.
|
- This alias does not introduce a new runtime type or wrapper layer.
|
||||||
- It preserves the same async lifecycle helpers as other async logger aliases.
|
- It preserves the same async lifecycle helpers as other async logger aliases.
|
||||||
|
- Because this is only an alias, methods that are async on `AsyncLogger[@bitlogger.FormattedConsoleSink]` remain async here as well.
|
||||||
- The alias exists to give application code a clearer public name when it wants the concrete text-console sink shape explicitly.
|
- The alias exists to give application code a clearer public name when it wants the concrete text-console sink shape explicitly.
|
||||||
- `build_application_text_async_logger(...)` returns this alias.
|
- `build_application_text_async_logger(...)` returns this alias.
|
||||||
|
|
||||||
@@ -53,12 +54,12 @@ In this example, the application alias keeps the same underlying async logger be
|
|||||||
|
|
||||||
When caller code should know it is working with the text-console variant:
|
When caller code should know it is working with the text-console variant:
|
||||||
```moonbit
|
```moonbit
|
||||||
fn start_text_async(logger : ApplicationTextAsyncLogger) -> Unit {
|
async fn start_text_async(logger : ApplicationTextAsyncLogger) -> Unit {
|
||||||
logger.run()
|
logger.run()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, the app-facing alias communicates the concrete text-console async shape directly.
|
In this example, the app-facing alias communicates the concrete text-console async shape directly, while `run()` keeps its async calling contract.
|
||||||
|
|
||||||
### Error Case
|
### Error Case
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user