Class GatewayWorker
- Namespace
- FoundationaLLM.Gateway.Services
- Assembly
- FoundationaLLM.Gateway.dll
Background worker used to execute the Gateway core.
public class GatewayWorker : BackgroundService, IHostedService, IDisposable
- Inheritance
-
GatewayWorker
- Implements
- Inherited Members
- Extension Methods
Constructors
GatewayWorker(IGatewayCore, ILogger<GatewayWorker>)
Background worker used to execute the Gateway core.
public GatewayWorker(IGatewayCore gatewayService, ILogger<GatewayWorker> logger)
Parameters
gatewayService
IGatewayCoreThe IGatewayCore providing the gateway functionalities.
logger
ILogger<GatewayWorker>The ILogger used for logging.
Methods
ExecuteAsync(CancellationToken)
This method is called when the IHostedService starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingToken
CancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.
StopAsync(CancellationToken)
Triggered when the application host is performing a graceful shutdown.
public override Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenIndicates that the shutdown process should no longer be graceful.