Skip to content

StorageFaultGrain Methods

Grain that tracks storage exceptions to be injected.

AddFaultOnClear(GrainId, Exception)

View source
public Task AddFaultOnClear(GrainId grainId, Exception exception)
Adds a storage exception to be thrown when the referenced grain clears state in a storage provider

Parameters

grainIdGrainId
exceptionException

Returns

Task.

AddFaultOnRead(GrainId, Exception)

View source
public Task AddFaultOnRead(GrainId grainId, Exception exception)
Adds a storage exception to be thrown when the referenced grain reads state from a storage provider

Parameters

grainIdGrainId
exceptionException

Returns

Task.

AddFaultOnWrite(GrainId, Exception)

View source
public Task AddFaultOnWrite(GrainId grainId, Exception exception)
Adds a storage exception to be thrown when the referenced grain writes state to a storage provider

Parameters

grainIdGrainId
exceptionException

Returns

Task.

OnActivateAsync(CancellationToken)

override
View source
public override Task OnActivateAsync(CancellationToken cancellationToken)
This method is called at the end of the process of activating a grain. It is called before any messages have been dispatched to the grain. For grains with declared persistent state, this method is called after the State property has been populated.

Parameters

cancellationTokenCancellationToken
A cancellation token which signals when activation is being canceled.

OnClear(GrainId)

View source
public Task OnClear(GrainId grainId)
Throws a storage exception if one has been added for the grain reference for clearing state.

Parameters

grainIdGrainId

OnRead(GrainId)

View source
public Task OnRead(GrainId grainId)
Throws a storage exception if one has been added for the grain reference for reading.

Parameters

grainIdGrainId

OnWrite(GrainId)

View source
public Task OnWrite(GrainId grainId)
Throws a storage exception if one has been added for the grain reference for writing.

Parameters

grainIdGrainId