1.2 KiB
1.2 KiB
Implementation Spec: Round 16 — COMPLETE
Goal
Make the round-7-15 abstractions actually usable — a single, runnable, wired example showing high-level primitives composing together.
New File
examples/high_level.rs (mytheclipse-core)
crates/mytheclipse/examples/high_level.rs
- One realistic flow demoing, wired together:
- RuntimeConfig::auto() — auto thread/core sizing from host CPU
- parallel_map — bounded fan-out + AggregateError
- RetryExt — ergonomic .retry() on a Future
- ShutdownGuard — RAII exactly-once cleanup
- AutoReconnectPool — self-healing resource pool (dead value replaced)
- AutoMetricsServiceBuilder — auto latency/outcome metrics
- Run:
cargo run -p mytheclipse --features full --example high_level
Verified Output (real run, 8-core host)
1. RuntimeConfig::auto() -> worker=8, blocking=12, compute=8, io=4
2. parallel_map -> [10, 20, 30, 40, 50]
3. RetryExt with 4 attempts -> 42
4. ShutdownGuard fired 1x (exactly-once, even on unwind)
5. AutoReconnectPool first acquire -> 999
6. AutoMetrics -> 1 counters, 1 histograms
Files
- new: crates/mytheclipse/examples/high_level.rs
Build: exit 0. Run: succeeds (verified above).