Architecture
This section documents the internal design decisions and guarantees of grelmicro.
- Concurrency runtime: Why grelmicro targets asyncio directly and not Trio or AnyIO.
- Backend Registry: Shared registry pattern for swappable backends.
- Configuration: Explicit construction paths,
from_config(...), optional env resolution where it fits, and the library-not-app boundary. - Live reconfiguration: Atomic config swap on a live component, the
Reconfigurablemixin, and reader safety. - Import Strategy: Why backends are imported from submodules, not re-exported.
- Plugins: Entry-point groups that let third-party packages register Providers and Adapters.
- Multiple apps: When two
Grelmicroapps can run concurrently, and whyLog,Trace, andMetricsare the exception. - Decorators: Which decorators take the bare
@decoform, which require@deco(...), and which wrap sync functions. - API Conventions: Constructor and factory rules: positional
nameon patterns, keyword-onlynameon components, factory classmethods for algorithms. - Coordination: Worker identity, token generation, lock design, and cleanup strategy.
- Kubernetes Backend: Lease resources, optimistic concurrency, and name sanitization.
- SQLite Backend: WAL mode.
- Tracing: Context stack, concurrency safety, and decoupled layering.
- Testing:
micro.override(...)block and pytest conftest recipe.