Request Dispatch
Decision
NOF keeps generic command and notification dispatch, but RPC-style request handling is centered on strongly typed IRpcService contracts and RpcServer<TService> implementations.
Current Invocation Model
- RPC operations: call
IRpcServicemethods through generated RPC clients or local server dispatch. - Command sending: use
ICommandSender. - Notification publishing: use
INotificationPublisher. - Deferred dispatch: use
ICommandSender.DeferSend(...)andINotificationPublisher.DeferPublish(...)to stage outbox messages beforeSaveChangesAsync(). - Streaming RPC operations use
StreamingResult<T>at the contract layer,Task<StreamingResult<T>>at the client layer, andIAsyncEnumerable<T>inside application handlers.
Notes
- HTTP exposure for RPC services is registered through
builder.AddRpcServer<TRpcServer>()and mapped automatically during application initialization. - OpenAPI registration is always enabled by
NOFWebApplicationBuilder.Create(args), butapp.MapOpenApi()remains an explicit host decision. - Application implementations are built around
RpcServer<TService>rather than ad-hoc request-dispatch APIs. RpcServer<TService>discovery generatesLocal{RpcServerName}Client; the client interface is selected throughIRpcClient<TService>rather than a naming convention or marker attribute.- ASP.NET Core hosting maps streaming RPC HTTP endpoints to .NET 10 server-sent events.