Class TerminalHttpRouter
Represents the HTTP router responsible for managing HTTP communication in the terminal. This router handles incoming HTTP commands and routes them to the appropriate command runners.
public class TerminalHttpRouter : ITerminalRouter<TerminalHttpRouterContext>
- Inheritance
-
TerminalHttpRouter
- Implements
- Inherited Members
Constructors
TerminalHttpRouter(ICommandRouter, ITerminalExceptionHandler, ITerminalProcessor, IOptions<TerminalOptions>, ILogger<TerminalHttpRouter>)
Initializes a new instance of the TerminalHttpRouter class.
public TerminalHttpRouter(ICommandRouter commandRouter, ITerminalExceptionHandler exceptionHandler, ITerminalProcessor terminalProcessor, IOptions<TerminalOptions> options, ILogger<TerminalHttpRouter> logger)
Parameters
commandRouterICommandRouterThe command router for routing commands to specific handlers.
exceptionHandlerITerminalExceptionHandlerThe exception handler for handling errors that occur during command routing.
terminalProcessorITerminalProcessorThe terminal processing queue.
optionsIOptions<TerminalOptions>The options configuration for the terminal router.
loggerILogger<TerminalHttpRouter>The logger instance for logging router events and errors.
Properties
IsRunning
Gets a value indicating whether the TerminalHttpRouter is running.
public bool IsRunning { get; protected set; }
Property Value
Name
The terminal router name.
public string Name { get; }
Property Value
Methods
RunAsync(TerminalHttpRouterContext)
Runs the HTTP router asynchronously and begins handling client requests indefinitely. The server will continue running until a cancellation is requested via the context.
public Task RunAsync(TerminalHttpRouterContext context)
Parameters
contextTerminalHttpRouterContextThe terminal context containing configuration and cancellation token.
Returns
- Task
A task that represents the asynchronous operation of running the server.
Exceptions
- TerminalException
Thrown when the start mode is not configured for HTTP.