Example #1
0
        /// <summary>
        /// Get a reference to the <see cref="GrainService"/> responsible for actioning the request based on the <paramref name="callingGrainId"/>.
        /// </summary>
        protected TGrainService GetGrainService(GrainId callingGrainId)
        {
            var hashCode    = callingGrainId.GetUniformHashCode();
            var destination = ringProvider.GetPrimaryTargetSilo(hashCode);

            var grainId      = SystemTargetGrainId.CreateGrainServiceGrainId(grainType, destination);
            var grainService = grainFactory.GetSystemTarget <TGrainService>(grainId);

            return(grainService);
        }
        private SiloAddress MapGrainReferenceToSiloRing(GrainReference grainRef)
        {
            var hashCode = grainRef.GetUniformHashCode();

            return(ConsistentRingProvider.GetPrimaryTargetSilo(hashCode));
        }
Example #3
0
 public Task <SiloAddress> GetConsistentRingPrimaryTargetSilo(uint key)
 {
     return(Task.FromResult(consistentRingProvider.GetPrimaryTargetSilo(key)));
 }