Interface ICarrotMiddleware
- Namespace
- CarrotMQ.Core.MessageProcessing.Middleware
- Assembly
- CarrotMQ.Core.dll
Defines a middleware for the message processing pipeline"/>
public interface ICarrotMiddleware
Methods
InvokeAsync(MiddlewareContext, Func<Task>)
Entry point for the middleware.
The middleware must call the next delegate to proceed to the next middleware.
Example:
public async Task InvokeAsync(MiddlewareContext context, Func<Task> next)
{
//Do preprocessing
//The next middleware or the handler is called
await next();
//Do postprocessing
}
Task InvokeAsync(MiddlewareContext context, Func<Task> nextAsync)
Parameters
contextMiddlewareContextnextAsyncFunc<Task>