예제 #1
0
        public async Task Ping(NotAnActor peer, int counter)
        {
            await Task.Yield();

            this.PingCount++;

            if (counter > 0)
            {
                await peer.Ping(this, counter - 1);
            }
        }
예제 #2
0
        public void TestPingNotActor()
        {
            NotAnActor ping = new NotAnActor();
            NotAnActor pong = new NotAnActor();

            Task t = ping.Ping(pong, 10);

            t.Wait();

            Assert.AreEqual(6, ping.PingCount);
            Assert.AreEqual(5, pong.PingCount);
        }
예제 #3
0
        public void TestPingNotActor()
        {
            NotAnActor ping = new NotAnActor();
            NotAnActor pong = new NotAnActor();

            Task t = ping.Ping(pong, 10);

            t.Wait();

            Assert.AreEqual(6, ping.PingCount);
            Assert.AreEqual(5, pong.PingCount);
        }
예제 #4
0
        public async Task Ping(NotAnActor peer, int counter)
        {
            await Task.Yield();

            this.PingCount++;

            if (counter > 0)
            {
                await peer.Ping(this, counter - 1);
            }
        }