コード例 #1
0
        public void Configure(IGrainContext context)
        {
            var component = context.GetComponent <GrainCanInterleave>();

            if (component is null)
            {
                component = new GrainCanInterleave();
                context.SetComponent <GrainCanInterleave>(component);
            }

            component.MayInterleavePredicates.Add(_mayInterleavePredicate);
        }
コード例 #2
0
        public void Configure(GrainType grainType, GrainProperties properties, GrainTypeSharedContext shared)
        {
            if (properties.Properties.TryGetValue(WellKnownGrainTypeProperties.Reentrant, out var value) && bool.Parse(value))
            {
                var component = shared.GetComponent <GrainCanInterleave>();
                if (component is null)
                {
                    component = new GrainCanInterleave();
                    shared.SetComponent <GrainCanInterleave>(component);
                }

                component.MayInterleavePredicates.Add(_ => true);
            }
        }