IGrainContext Interface

Definition

Represents a grain from the perspective of the runtime.

public interface IGrainContext : IEquatable<Orleans.Runtime.IGrainContext>, Orleans.Serialization.Invocation.ITargetHolder
type IGrainContext = interface
    interface ITargetHolder
    interface IEquatable<IGrainContext>
Public Interface IGrainContext
Implements IEquatable(Of IGrainContext), ITargetHolder
Derived
Implements

Properties

ActivationId

Gets the activation id.

ActivationServices

Gets the IServiceProvider that provides access to the grain activation's service container.

Address

Gets the activation address.

Deactivated

Gets the Task which completes when the grain has deactivated.

GrainId

Gets the grain identity.

GrainInstance

Gets the grain instance, or null if the grain instance has not been set yet.

GrainReference

Gets a reference to this grain.

ObservableLifecycle

Gets the observable Grain lifecycle, which can be used to add lifecycle hooks.

Scheduler

Gets the scheduler.

Methods

Activate(Dictionary<String,Object>, Nullable<CancellationToken>)

Start activating this instance.

Deactivate(DeactivationReason, Nullable<CancellationToken>)

Start deactivating this instance.

GetComponent<TComponent>()

Gets the component with the specified type.

(Inherited from ITargetHolder)
GetTarget<TTarget>()

Gets the target.

(Inherited from ITargetHolder)
Migrate(Dictionary<String,Object>, Nullable<CancellationToken>)

Starts an attempt to migrating this instance to another location. Migration captures the current RequestContext, 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>(TComponent)

Sets the provided value as the component for type TComponent.

Extension Methods

GetGrainExtension<TComponent>(IGrainContext)

Used by generated code for IGrainExtension interfaces.

DeactivateAsync(IGrainContext, DeactivationReason, Nullable<CancellationToken>)

Deactivates the provided grain.

Applies to