Class CommandMiddleware
- Namespace
- Signal.Application.Commands
- Assembly
- Signal.Application.dll
Last built-in pipeline step: parses prefixed text messages, executes the matching command, marks the message as handled and passes the outcome to ICommandResultHandler. Reactions are never treated as commands.
public sealed class CommandMiddleware : IMessageMiddleware
- Inheritance
-
CommandMiddleware
- Implements
- Inherited Members
Constructors
CommandMiddleware(ICommandParser, ICommandExecutor, ICommandResultHandler)
Last built-in pipeline step: parses prefixed text messages, executes the matching command, marks the message as handled and passes the outcome to ICommandResultHandler. Reactions are never treated as commands.
public CommandMiddleware(ICommandParser parser, ICommandExecutor executor, ICommandResultHandler results)
Parameters
parserICommandParserThe command parser.
executorICommandExecutorThe command executor.
resultsICommandResultHandlerThe result handler.
Methods
InvokeAsync(MessageContext, MessageDelegate)
Processes the message. Call next to continue; skip it to stop processing.
public Task InvokeAsync(MessageContext context, MessageDelegate next)
Parameters
contextMessageContextThe message being processed.
nextMessageDelegateThe rest of the pipeline.
Returns
- Task
A task that completes when this step (and everything it invoked) has finished.