Table of Contents

Class NullCacheCoordinator

Namespace
CL.MySQL2.Services
Assembly
CL.MySQL2.dll

Single-node default: no fan-out, and every node (there is only one) always wins the refresh lease — so behaviour is identical to the pre-coordination library.

public sealed class NullCacheCoordinator : ICacheCoordinator, IAsyncDisposable
Inheritance
NullCacheCoordinator
Implements
Inherited Members

Fields

Instance

Shared instance — stateless.

public static readonly NullCacheCoordinator Instance

Field Value

NullCacheCoordinator

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

OnInvalidation(Action<string>)

Registers a handler invoked when a peer broadcasts an invalidation. The handler bumps the local table version and evicts matching entries (it must NOT re-broadcast — that would loop). Called once when the coordinator is installed.

public void OnInvalidation(Action<string> handler)

Parameters

handler Action<string>

PublishInvalidationAsync(string, CancellationToken)

Broadcasts that tableName was mutated on this node so peers can invalidate their cached entries for it. Fire-and-forget from the caller's perspective; implementations should not throw on transient transport failures.

public Task PublishInvalidationAsync(string tableName, CancellationToken ct = default)

Parameters

tableName string
ct CancellationToken

Returns

Task

TryAcquireRefreshLeaseAsync(string, TimeSpan, CancellationToken)

Attempts to acquire the refresh lease for poolName for the next lease window. Returns true if this node should perform the refresh, false if a peer already holds it. The single-node default always returns true.

public Task<bool> TryAcquireRefreshLeaseAsync(string poolName, TimeSpan lease, CancellationToken ct = default)

Parameters

poolName string
lease TimeSpan
ct CancellationToken

Returns

Task<bool>