Class InstanceRecoveryService
- Namespace
- Bielu.Microservices.Orchestrator.Storage
- Assembly
- Bielu.Microservices.Orchestrator.dll
Hosted service that runs on startup to reconcile the desired state in the IInstanceStore with the actual state of containers in the runtime.
public class InstanceRecoveryService : BackgroundService, IHostedService, IDisposable
- Inheritance
-
InstanceRecoveryService
- Implements
- Inherited Members
Constructors
InstanceRecoveryService(IInstanceStore, IContainerManager, ILogger<InstanceRecoveryService>)
Hosted service that runs on startup to reconcile the desired state in the IInstanceStore with the actual state of containers in the runtime.
public InstanceRecoveryService(IInstanceStore instanceStore, IContainerManager containerManager, ILogger<InstanceRecoveryService> logger)
Parameters
instanceStoreIInstanceStorecontainerManagerIContainerManagerloggerILogger<InstanceRecoveryService>
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
stoppingTokenCancellationTokenTriggered when StopAsync(CancellationToken) is called.
Returns
Remarks
See Worker Services in .NET for implementation guidelines.
ReconcileAllAsync(CancellationToken)
Performs the reconciliation of all managed instances in the store with the runtime. Public to allow unit testing without blocking the host startup.
public Task ReconcileAllAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken