Skip to content

InProcessTestCluster.WaitForDeactivationAsync(IAddressable)

WaitForDeactivationAsync(IAddressable)

View source
public Task WaitForDeactivationAsync(IAddressable grain)
Gets a System.Threading.Tasks.Task that completes when the current activation of the specified grain finishes deactivating. If the grain is not currently activated, returns System.Threading.Tasks.Task.CompletedTask.

Parameters

grainIAddressable
The grain to observe.

Returns

A task that completes when the grain's current activation has deactivated.

Examples

var deactivated = cluster.WaitForDeactivationAsync(grain.GetGrainId());
await grain.DoDeactivate();
await deactivated;