IGrainContext
interface
Namespace: Orleans.Runtime
Represents a grain from the perspective of the runtime.
public interface IGrainContext : ITargetHolder, IEquatable<IGrainContext>Properties
ActivationIdGets the activation id.ActivationServicesGets theSystem.IServiceProviderthat provides access to the grain activation's service container.AddressGets the activation address.DeactivatedGets theSystem.Threading.Tasks.Taskwhich completes when the grain has deactivated.GrainIdGets the grain identity.GrainInstanceGets the grain instance, ornullif the grain instance has not been set yet.GrainReferenceGets a reference to this grain.ObservableLifecycleGets the observableGrainlifecycle, which can be used to add lifecycle hooks.SchedulerGets the scheduler.
Methods
Activate(Dictionary<string, object>, CancellationToken)Start activating this instance.Deactivate(DeactivationReason, CancellationToken)Start deactivating this instance.Migrate(Dictionary<string, object>, CancellationToken)Starts an attempt to migrating this instance to another location. Migration captures the currentRequestContext, making it available to the activation's placement director so that it can consider it when selecting a new location. Migration will occur asynchronously, when no requests are executing, and will not occur if the activation's placement director does not select an alternative location.ReceiveMessage(object)Submits an incoming message to this instance.Rehydrate(IRehydrationContext)Start rehydrating this instance from the provided rehydration context.SetComponent(TComponent?)Sets the provided value as the component for typeTComponent.
