GrainReference 类

定义

这是所有 grain 引用的基类。

[System.Serializable]
public class GrainReference : IEquatable<Orleans.Runtime.GrainReference>, Orleans.Runtime.IAddressable, System.Runtime.Serialization.ISerializable
[Orleans.Alias("GrainRef")]
[Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.ValueTask<>), typeof(Orleans.Runtime.Request<>))]
[Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.ValueTask), typeof(Orleans.Runtime.Request))]
[Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.Task<>), typeof(Orleans.Runtime.TaskRequest<>))]
[Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.Task), typeof(Orleans.Runtime.TaskRequest))]
[Orleans.DefaultInvokableBaseType(typeof(System.Void), typeof(Orleans.Runtime.VoidRequest))]
[Orleans.DefaultInvokableBaseType(typeof(System.Collections.Generic.IAsyncEnumerable<>), typeof(Orleans.Runtime.AsyncEnumerableRequest<>))]
public class GrainReference : IEquatable<Orleans.Runtime.GrainReference>, ISpanFormattable, Orleans.Runtime.IAddressable
[<System.Serializable>]
type GrainReference = class
    interface IAddressable
    interface IEquatable<GrainReference>
    interface ISerializable
[<Orleans.Alias("GrainRef")>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.ValueTask<>), typeof(Orleans.Runtime.Request<>))>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.ValueTask), typeof(Orleans.Runtime.Request))>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.Task<>), typeof(Orleans.Runtime.TaskRequest<>))>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Threading.Tasks.Task), typeof(Orleans.Runtime.TaskRequest))>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Void), typeof(Orleans.Runtime.VoidRequest))>]
[<Orleans.DefaultInvokableBaseType(typeof(System.Collections.Generic.IAsyncEnumerable<>), typeof(Orleans.Runtime.AsyncEnumerableRequest<>))>]
type GrainReference = class
    interface IAddressable
    interface IEquatable<GrainReference>
    interface ISpanFormattable
    interface IFormattable
Public Class GrainReference
Implements IAddressable, IEquatable(Of GrainReference), ISerializable
Public Class GrainReference
Implements IAddressable, IEquatable(Of GrainReference), ISpanFormattable
继承
GrainReference
属性
实现

构造函数

GrainReference(GrainReference)

构造 grain 引用的副本。

GrainReference(GrainReference, InvokeMethodOptions)

这是所有 grain 引用的基类。

GrainReference(GrainReferenceShared, IdSpan)

初始化 GrainReference 类的新实例。

GrainReference(SerializationInfo, StreamingContext)

这是所有 grain 引用的基类。

字段

SystemTargetSilo

从生成的代码调用。

属性

CodecProvider

获取序列化编解码器提供程序。

CopyContextPool

获取序列化副本上下文池。

GrainId

获取粒度 ID。

GrainIdentity

这是所有 grain 引用的基类。

GrainServiceSiloAddress

这是所有 grain 引用的基类。

InterfaceId

由生成的子类实现,以返回在生成的代码中实现的常量。

InterfaceName

获取接口名称。

InterfaceType

获取接口类型。

InterfaceVersion

获取接口版本。

IsGrainService

这是所有 grain 引用的基类。

IsInitializedSystemTarget

系统目标的运行时环境是否已初始化。 从生成的代码调用。

方法

Cast<TGrainInterface>()

创建实现指定 grain 接口的新 grain 引用。

CopyGrainReference(Object, ICopyContext)

grain 引用的复制器函数。

DeserializeGrainReference(Type, IDeserializationContext)

grain 引用的反序列化程序函数。

Equals(GrainReference)

这是所有 grain 引用的基类。

Equals(Object)

测试此引用是否与另一个对象相等。 如果两个 grain 引用都引用同一个 grain,则它们相等。

GetHashCode()

计算粒度引用的哈希代码。

GetInvokable<TInvokable>()

这是所有 grain 引用的基类。

GetMethodName(Int32, Int32)

返回与指定的 interfaceId 和 methodId 值关联的方法名称。

GetObjectData(SerializationInfo, StreamingContext)

这是所有 grain 引用的基类。

GetUniformHashCode()

获取此 grain 引用的统一哈希代码。

Invoke(IRequest)

调用提供的方法。

InvokeAsync(IRequest)

调用提供的方法。

InvokeAsync<T>(IRequest)

调用提供的方法。

InvokeMethodAsync<T>(Int32, Object[], InvokeMethodOptions, SiloAddress)

从生成的代码调用。

InvokeOneWayMethod(Int32, Object[], InvokeMethodOptions, SiloAddress)

从生成的代码调用。

IsCompatible(Int32)

在生成的代码中实现。

SerializeGrainReference(Object, ISerializationContext, Type)

grain 引用的序列化程序函数。

ToKeyInfo()

这是所有 grain 引用的基类。

ToKeyString()

以字符串的形式获取此粒度的键值。

ToString()

返回此引用的字符串表示形式。

运算符

Equality(GrainReference, GrainReference)

比较两个引用是否相等。 如果两个 grain 引用都引用同一个 grain,则它们相等。

Inequality(GrainReference, GrainReference)

比较两个引用的不相等性。 如果两个 grain 引用都引用同一个 grain,则它们相等。

显式接口实现

IFormattable.ToString(String, IFormatProvider)

这是所有 grain 引用的基类。

ISpanFormattable.TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

这是所有 grain 引用的基类。

扩展方法

AsReference(IAddressable, Type)

返回对提供的 grain 的类型化引用。

AsReference<TGrainInterface>(IAddressable)

返回对提供的 grain 的类型化引用。

BindGrainReference(IAddressable, IGrainFactory)

将 grain 引用绑定到提供的 IGrainFactory

Cast(IAddressable, Type)

返回对提供的 grain 的类型化引用。

Cast<TGrainInterface>(IAddressable)

返回对提供的 grain 的类型化引用。

GetGrainId(IAddressable)

返回与提供的 grain 对应的 grain ID。

GetPrimaryKey(IAddressable)

返回 Guid grain 主键的表示形式。

GetPrimaryKey(IAddressable, String)

返回 Guid grain 主键的表示形式。

GetPrimaryKeyLong(IAddressable)

返回 long grain 主键的表示形式。

GetPrimaryKeyLong(IAddressable, String)

返回 long grain 主键的表示形式。

GetPrimaryKeyString(IAddressable)

返回 string grain 的主键。

IsPrimaryKeyBasedOnLong(IAddressable)

返回主键的一部分是否为 类型 long

ToShortKeyString(GrainReference)

grain 引用的键字符串与 ToKeyString 一样唯一,但更短且可分析。 适用于唯一性和简洁性非常重要的情况。

适用于