Skip to content

FaultInjectionGrainStorage Methods

Fault injection decorator for storage providers. This allows users to inject storage exceptions to test error handling scenarios.

ClearStateAsync(string, GrainId, IGrainState<T>)

View source
public Task ClearStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Faults if exception is provided, otherwise calls through to decorated storage provider.

Parameters

grainTypestring
grainIdGrainId
grainStateIGrainState<T>

Returns

Completion promise for the Delete operation on the specified grain.

Participate(ISiloLifecycle)

View source
public void Participate(ISiloLifecycle lifecycle)
Adds the provided observer as a participant in the lifecycle.

Parameters

lifecycleISiloLifecycle
The observer.

ReadStateAsync(string, GrainId, IGrainState<T>)

View source
public Task ReadStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Faults if exception is provided, otherwise calls through to decorated storage provider.

Parameters

grainTypestring
grainIdGrainId
grainStateIGrainState<T>

Returns

Completion promise for the Read operation on the specified grain.

WriteStateAsync(string, GrainId, IGrainState<T>)

View source
public Task WriteStateAsync<T>(string grainType, GrainId grainId, IGrainState<T> grainState)
Faults if exception is provided, otherwise calls through to decorated storage provider.

Parameters

grainTypestring
grainIdGrainId
grainStateIGrainState<T>

Returns

Completion promise for the Write operation on the specified grain.