Skip to content

TestCluster.WaitForDeactivationAsync(GrainId)

WaitForDeactivationAsync(GrainId)

View source
public Task WaitForDeactivationAsync(GrainId grainId)
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

grainIdGrainId
The ID of 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;