当前位置: 首页>>代码示例>>C#>>正文


C# GrainId.GetTypeCode方法代码示例

本文整理汇总了C#中GrainId.GetTypeCode方法的典型用法代码示例。如果您正苦于以下问题:C# GrainId.GetTypeCode方法的具体用法?C# GrainId.GetTypeCode怎么用?C# GrainId.GetTypeCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GrainId的用法示例。


在下文中一共展示了GrainId.GetTypeCode方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCollectActivation

 private void OnCollectActivation(GrainId grainId)
 {
     int other = grainId.GetTypeCode();
     int self = Data.Address.Grain.GetTypeCode();
     if (other == self)
     {
         IBusyActivationGcTestGrain1 g = GrainFactory.GetGrain<IBusyActivationGcTestGrain1>(grainId.GetPrimaryKey());
         for (int i = 0; i < burstCount; ++i)
         {
             g.Delay(TimeSpan.FromMilliseconds(10)).Ignore();
         }
     }         
 }
开发者ID:osjimenez,项目名称:orleans,代码行数:13,代码来源:ActivationGCTestGrains.cs

示例2: GetDetailedGrainReport

        public DetailedGrainReport GetDetailedGrainReport(GrainId grain)
        {
            var report = new DetailedGrainReport
            {
                Grain = grain,
                SiloAddress = LocalSilo,
                SiloName = localSiloName,
                LocalCacheActivationAddresses = directory.GetLocalCacheData(grain),
                LocalDirectoryActivationAddresses = directory.GetLocalDirectoryData(grain),
                PrimaryForGrain = directory.GetPrimaryForGrain(grain)
            };
            try
            {
                PlacementStrategy unused;
                string grainClassName;
                GrainTypeManager.GetTypeInfo(grain.GetTypeCode(), out grainClassName, out unused);
                report.GrainClassTypeName = grainClassName;
            }
            catch (Exception exc)
            {
                report.GrainClassTypeName = exc.ToString();
            }

            List<ActivationData> acts = activations.FindTargets(grain);
            report.LocalActivations = acts != null ? 
                acts.Select(activationData => activationData.ToDetailedString()).ToList() : 
                new List<string>();
            return report;
        }
开发者ID:kucheruk,项目名称:orleans,代码行数:29,代码来源:Catalog.cs

示例3: GetGrainTypeInfo

 public static void GetGrainTypeInfo(this IPlacementContext @this, GrainId grainId, out string grainClass, out PlacementStrategy placement, out MultiClusterRegistrationStrategy activationStrategy, string genericArguments = null)
 {
     @this.GetGrainTypeInfo(grainId.GetTypeCode(), out grainClass, out placement, out activationStrategy, genericArguments);
 }
开发者ID:MikeHardman,项目名称:orleans,代码行数:4,代码来源:IPlacementContext.cs

示例4: GetGrainTypeName

 public static string GetGrainTypeName(this IPlacementContext @this, GrainId grainId, string genericArguments = null)
 {
     return @this.GetGrainTypeName(grainId.GetTypeCode(), genericArguments);
 }
开发者ID:MikeHardman,项目名称:orleans,代码行数:4,代码来源:IPlacementContext.cs

示例5: GetGrainPlacementStrategy

 public static PlacementStrategy GetGrainPlacementStrategy(this IPlacementContext @this, GrainId grainId, string genericArguments = null)
 {
     return @this.GetGrainPlacementStrategy(grainId.GetTypeCode(), genericArguments);
 }
开发者ID:MikeHardman,项目名称:orleans,代码行数:4,代码来源:IPlacementContext.cs

示例6: GetCompatibleSiloList

 public IList<SiloAddress> GetCompatibleSiloList(GrainId grain)
 {
     var typeCode = grain.GetTypeCode();
     var compatibleSilos = GrainTypeManager.GetSupportedSilos(typeCode).Intersect(AllActiveSilos).ToList();
     if (compatibleSilos.Count == 0)
         throw new OrleansException($"TypeCode ${typeCode} not supported in the cluster");
     return compatibleSilos;
 }
开发者ID:Carlm-MS,项目名称:orleans,代码行数:8,代码来源:Catalog.cs

示例7: TryGetImplicitSubscriptionGuid

        /// <summary>
        /// Try to get the implicit subscriptionId.
        /// If an implicit subscription exists, return a subscription Id that is unique per grain type, grainId, namespace combination.
        /// </summary>
        /// <param name="grainId"></param>
        /// <param name="streamId"></param>
        /// <param name="subscriptionId"></param>
        /// <returns></returns>
        internal bool TryGetImplicitSubscriptionGuid(GrainId grainId, StreamId streamId, out Guid subscriptionId)
        {
            subscriptionId = Guid.Empty;

            if (!HasImplicitSubscription(streamId.Namespace, grainId.GetTypeCode()))
            {
                return false;
            }

            // make subscriptionId
            subscriptionId = MakeSubscriptionGuid(grainId, streamId);

            return true;
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:22,代码来源:ImplicitStreamSubscriberTable.cs

示例8: IsImplicitSubscriber

 /// <summary>
 /// Determines whether the specified grain is an implicit subscriber of a given stream.
 /// </summary>
 /// <param name="grainId">The grain identifier.</param>
 /// <param name="streamId">The stream identifier.</param>
 /// <returns>true if the grain id describes an implicit subscriber of the stream described by the stream id.</returns>
 internal bool IsImplicitSubscriber(GrainId grainId, StreamId streamId)
 {
     return HasImplicitSubscription(streamId.Namespace, grainId.GetTypeCode());
 }
开发者ID:osjimenez,项目名称:orleans,代码行数:10,代码来源:ImplicitStreamSubscriberTable.cs

示例9: MakeSubscriptionGuid

        /// <summary>
        /// Create a subscriptionId that is unique per grainId, grainType, namespace combination.
        /// </summary>
        /// <param name="grainId"></param>
        /// <param name="streamId"></param>
        /// <returns></returns>
        private Guid MakeSubscriptionGuid(GrainId grainId, StreamId streamId)
        {
            // first int in guid is grain type code
            int grainIdTypeCode = grainId.GetTypeCode();

            return MakeSubscriptionGuid(grainIdTypeCode, streamId);
        }
开发者ID:osjimenez,项目名称:orleans,代码行数:13,代码来源:ImplicitStreamSubscriberTable.cs

示例10: GetGrainTypeInfo

 public static void GetGrainTypeInfo(this IPlacementContext @this, GrainId grainId, out string grainClass, out PlacementStrategy placement, string genericArguments = null)
 {
     @this.GetGrainTypeInfo(grainId.GetTypeCode(), out grainClass, out placement, genericArguments);
 }
开发者ID:stanroze,项目名称:orleans,代码行数:4,代码来源:IPlacementContext.cs


注:本文中的GrainId.GetTypeCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。