Class InMemoryInstanceStore
- Namespace
- Bielu.Microservices.Orchestrator.Storage
- Assembly
- Bielu.Microservices.Orchestrator.dll
In-memory implementation of IInstanceStore. Suitable for testing and ephemeral workloads where persistence across restarts is not needed.
public class InMemoryInstanceStore : IInstanceStore
- Inheritance
-
InMemoryInstanceStore
- Implements
- Inherited Members
Methods
GetAllAsync(CancellationToken)
Gets all managed instance records.
public Task<IReadOnlyList<ManagedInstance>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
GetAsync(string, CancellationToken)
Gets a managed instance by its identifier.
public Task<ManagedInstance?> GetAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringcancellationTokenCancellationToken
Returns
- Task<ManagedInstance>
The instance, or
nullif not found.
RemoveAsync(string, CancellationToken)
Removes a managed instance record by its identifier.
public Task RemoveAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringcancellationTokenCancellationToken
Returns
SaveAsync(ManagedInstance, CancellationToken)
Saves or updates a managed instance record.
public Task SaveAsync(ManagedInstance instance, CancellationToken cancellationToken = default)
Parameters
instanceManagedInstancecancellationTokenCancellationToken
Returns
UpdateContainerIdsAsync(string, IReadOnlyList<string>, CancellationToken)
Updates only the container IDs for an existing instance (e.g. after re-creation).
public Task UpdateContainerIdsAsync(string id, IReadOnlyList<string> containerIds, CancellationToken cancellationToken = default)
Parameters
idstringcontainerIdsIReadOnlyList<string>cancellationTokenCancellationToken