The async-only contract for process middleware. Implementations intercept
the pipeline by calling next to continue, or omitting
the call to short-circuit the chain.
public interface IProcessMiddleware
IProcessMiddleware is a first-class participant in the Process
Invocation Pipeline. It wraps cross-cutting concerns (logging, diagnostics,
policy enforcement, validation, instrumentation) around process execution
without coupling those concerns to the invoker. Registered middleware form an
ordered chain: each instance receives the next delegate that
invokes the subsequent middleware and, at the centre, the terminal pipeline that
actually starts the process. Calling next continues the chain; omitting the
call short-circuits it, so a middleware may observe, transform, or veto an
invocation before the process is ever launched. Middleware are resolved and invoked
by CliInvoke.Core.Middleware.MiddlewareChain in registration order.
kind:method, kind:property, kind:ctor. Press Esc to clear.InvokeAsync(InvocationContext, Func<InvocationContext, Task>)Invokes the middleware, optionally calling next to continue the pipeline.