示例#1
0
#pragma warning disable 1998
        public async Task <string> CallMethodTask_Block(string data)
        {
            string name = GetType().Name + ".CallMethodTask_Block";

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

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

            logger.Info(name + " Result=" + result);
            return(result);
        }
示例#2
0
        public async Task EchoGrain_Echo()
        {
            Stopwatch clock = new Stopwatch();

            clock.Start();
            grain = GrainClient.GrainFactory.GetGrain<IEchoTaskGrain>(Guid.NewGuid());
            logger.Info("CreateGrain took " + clock.Elapsed);

            clock.Restart();
            string received = await grain.EchoAsync(expectedEcho);
            logger.Info("EchoGrain.Echo took " + clock.Elapsed);

            Assert.AreEqual(expectedEcho, received);
        }
示例#3
0
        public async Task EchoGrain_Echo()
        {
            Stopwatch clock = new Stopwatch();

            clock.Start();
            grain = GrainClient.GrainFactory.GetGrain <IEchoTaskGrain>(Guid.NewGuid());
            logger.Info("CreateGrain took " + clock.Elapsed);

            clock.Restart();
            string received = await grain.EchoAsync(expectedEcho);

            logger.Info("EchoGrain.Echo took " + clock.Elapsed);

            Assert.AreEqual(expectedEcho, received);
        }
示例#4
0
        public async Task EchoGrain_Echo()
        {
            Stopwatch clock = new Stopwatch();

            clock.Start();
            grain = this.GrainFactory.GetGrain <IEchoTaskGrain>(Guid.NewGuid());
            this.Logger.LogInformation("CreateGrain took {Elapsed}", clock.Elapsed);

            clock.Restart();
            string received = await grain.EchoAsync(expectedEcho);

            this.Logger.LogInformation("EchoGrain.Echo took {Elapsed}", clock.Elapsed);

            Assert.Equal(expectedEcho, received);
        }