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); }
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); } }