rpc_dart_framework library
Client and server application framework for rpc_dart.
Core building blocks:
- RpcContainer — type-keyed DI (singleton + factory).
- RpcEnvConfig — typed, parsed access to environment variables.
- RpcModule — shared lifecycle base: configure DI, start/stop/health.
- RpcServerModule — server-side module: buildContracts per connection.
- RpcIsolateModule — server module variant that runs handlers in a dedicated isolate.
- RpcApp — application container with signal handling, graceful drain, topological module ordering, health aggregation, and auto-wired error/metrics interceptors. Use RpcApp.server.
- RpcTestApp — in-memory test harness (no network required).
- RpcAppHealth — aggregated health report from RpcApp.health.
- RpcCallEvent — per-call metrics record emitted by RpcAppConfig.onCall.
- RpcAppConfig — framework configuration (timeouts, hooks, env override).
- RpcCallSpy — test interceptor recording all calls.
- RpcFaultInjector — test interceptor injecting errors and latency.
Classes
- RpcApp
- The framework entry point.
- RpcAppConfig
- Framework-level configuration for RpcApp.
- RpcAppHealth
-
Aggregated health report returned by
RpcApp.healthandRpcTestApp.health. - RpcCallEvent
- One finished RPC call: succeeded, failed or cancelled.
- RpcCallSpy
- An interceptor that records every RPC call for later inspection.
- RpcContainer
- Lightweight type-keyed service container.
- RpcEnvConfig
- Typed, read-only view over environment variables.
- RpcFaultInjector
-
An
IRpcInterceptorthat injects errors or latency into specific RPC methods. - RpcIsolateModule
- A module whose contract handlers run inside a dedicated Dart isolate.
- RpcModule
- Shared lifecycle base for all framework modules.
- RpcServerModule
- A module that exposes RPC services on the server side.
- RpcTestApp
- In-process test harness for RpcModules.
Enums
- RpcAppHealthLevel
- Overall health level of the application.
Typedefs
- RpcCallEventHandler = void Function(RpcCallEvent event)
- Signature for the per-call metrics observer.
- RpcErrorHandler = void Function(Object error, StackTrace stackTrace, String serviceName, String methodName)
- Signature for the global error hook.