Exemplo n.º 1
0
        public async Task <string> AwaitAVGrainCallErrorAsync(string data)
        {
            logger.Info("IEchoGrainAsync.AwaitAVGrainErrorAsync=" + data);
            IEchoGrain avGrain = GrainFactory.GetGrain <IEchoGrain>(this.GetPrimaryKey());

            return(await avGrain.EchoError(data));
        }
Exemplo n.º 2
0
        public async Task <string> CallMethodAV_Await(string data)
        {
            string name = GetType().Name + ".CallMethodAV_Await";

            logger.Info(name + " Data=" + data);
            IEchoGrain avGrain = GrainFactory.GetGrain <IEchoGrain>(this.GetPrimaryKey());
            var        result  = await avGrain.Echo(data);

            logger.Info(name + " Result=" + result);
            return(result);
        }
Exemplo n.º 3
0
        public async Task <string> CallMethodAV_Await(string data)
        {
            string name = GetType().Name + ".CallMethodAV_Await";

            logger.LogInformation("{Name} Data={Data}", name, data);
            IEchoGrain avGrain = GrainFactory.GetGrain <IEchoGrain>(this.GetPrimaryKey());
            var        result  = await avGrain.Echo(data);

            logger.LogInformation("{Name} Result={Result}", name, result);
            return(result);
        }
Exemplo n.º 4
0
#pragma warning restore 1998

#pragma warning disable 1998
        public async Task <string> CallMethodAV_Block(string data)
        {
            string name = GetType().Name + ".CallMethodAV_Block";

            logger.Info(name + " Data=" + data);
            IEchoGrain avGrain = GrainFactory.GetGrain <IEchoGrain>(this.GetPrimaryKey());

            // Note: We deliberately use .Result here in this test case to block current executing thread
            var result = avGrain.Echo(data).Result;

            logger.Info(name + " Result=" + result);
            return(result);
        }
Exemplo n.º 5
0
        private void CreateGR(int n, int type)
        {
            Guid guid;

            if (type == 1)
            {
                guid = Guid.Parse(string.Format("00000000-0000-0000-0000-{0:X12}", n));
            }
            else
            {
                guid = Guid.Parse(string.Format("{0:X8}-0000-0000-0000-000000000000", n));
            }
            IEchoGrain grain   = GrainClient.GrainFactory.GetGrain <IEchoGrain>(guid);
            GrainId    grainId = ((GrainReference)grain.AsReference <IEchoGrain>()).GrainId;

            output.WriteLine("Guid = {0}, Guid.HashCode = x{1:X8}, GrainId.HashCode = x{2:X8}, GrainId.UniformHashCode = x{3:X8}", guid, guid.GetHashCode(), grainId.GetHashCode(), grainId.GetUniformHashCode());
        }