Interface IChronicleClient

Namespace
Cratis.Chronicle
Assembly
Cratis.Chronicle.dll

Defines the Cratis client API surface.

public interface IChronicleClient
Extension Methods

Properties

CausationManager

Gets the ICausationManager for the client.

ICausationManager CausationManager { get; }

Property Value

ICausationManager

Options

Gets the ChronicleOptions for the client.

ChronicleOptions Options { get; }

Property Value

ChronicleOptions

Methods

EvictEventStores()

Evict every cached IEventStore, unsubscribing each one's RegisterAll handler from the shared connection lifecycle.

void EvictEventStores()

Remarks

Used to release per-event-store subscriptions when the calling environment needs to fully reset client state without disposing the client itself — for example, between integration test classes that share an IChronicleClient instance. Without this, every IEventStore ever created stays subscribed to OnConnected and re-runs RegisterAll on subsequent reconnects, causing the kernel to receive a fanout of concurrent Ensure calls for the same event-store name.

GetEventStore(EventStoreName, EventStoreNamespaceName?)

Get an event store by name and optional namespace.

Task<IEventStore> GetEventStore(EventStoreName name, EventStoreNamespaceName? @namespace = null)

Parameters

name EventStoreName

Name of the event store to get.

namespace EventStoreNamespaceName

Optional namespace.

Returns

Task<IEventStore>

IEventStore.

Remarks

If no namespace is specified, the default namespace will be used.

GetEventStores(CancellationToken)

List all the event stores.

Task<IEnumerable<EventStoreName>> GetEventStores(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken.

Returns

Task<IEnumerable<EventStoreName>>

An asynchronous enumerable.