MigrateAsync(GrainId, SiloAddress?)
public Task MigrateAsync(GrainId grainId, SiloAddress? targetSilo = null) Migrates the current activation of the specified grain to a different silo and waits for migration to complete. If
targetSilo is specified, a placement hint is set to guide migration to that silo. Parameters
grainIdGrainId- The ID of the grain to migrate.
targetSiloSiloAddress?- The target silo address, or
nullto let the placement director choose.
Returns
A task that completes when the grain has been migrated (deactivated on the source silo).
Examples
var targetSilo = cluster.GetActiveSilos().First(s => s.SiloAddress != originalHost).SiloAddress; await cluster.MigrateAsync(grain.GetGrainId(), targetSilo);