Table of Contents

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

cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ManagedInstance>>

GetAsync(string, CancellationToken)

Gets a managed instance by its identifier.

public Task<ManagedInstance?> GetAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string
cancellationToken CancellationToken

Returns

Task<ManagedInstance>

The instance, or null if not found.

RemoveAsync(string, CancellationToken)

Removes a managed instance record by its identifier.

public Task RemoveAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string
cancellationToken CancellationToken

Returns

Task

SaveAsync(ManagedInstance, CancellationToken)

Saves or updates a managed instance record.

public Task SaveAsync(ManagedInstance instance, CancellationToken cancellationToken = default)

Parameters

instance ManagedInstance
cancellationToken CancellationToken

Returns

Task

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

id string
containerIds IReadOnlyList<string>
cancellationToken CancellationToken

Returns

Task