public void EnsureThatChildIsSendingMessages()
        {
            var mock  = ActorOf <MockUploadActor>("mock");
            var coord = ActorOf(CoordinatorActor.Props("192.168.1.148", mock));

            System.Threading.Thread.Sleep(20000);

            mock.Tell(new MockUploadActor.GetReadings(), TestActor);
            var r = ExpectMsg <List <DeviceReading> >(TimeSpan.FromSeconds(25));

            Assert.Greater(r.Count, 15);
        }
Example #2
0
        public void abort(int taskId)
        {
            Console.WriteLine("Aborting: " + taskId + "-" + Id);
            var workerKeys = new List <int>(Works.Keys);

            foreach (int workKey in workerKeys)
            {
                Work work = Works [workKey];

                if (work.TaskId == taskId)
                {
                    CoordinatorActor.Tell(new AbortWorkMessage(work.WorkId));
                    Works.Remove(workKey);
                }
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starting up system");

            using (var sys = Akka.Actor.ActorSystem.Create("DATC"))
            {
                var eh       = Helpers.EventHubConfig.Configuration;
                var uploader = sys.ActorOf(Actors.UploadActor.Props(eh.eventHubConnectionString, eh.eventHubName));
                // var uploader = sys.ActorOf(MockUploadActor.Props(), "mockMcMockFace");
                var coord = sys.ActorOf(CoordinatorActor.Props("192.168.1.148", uploader));

                Console.WriteLine("<Enter> to shutdown");
                Console.ReadLine();
                Console.WriteLine("<Enter> to confirm");
                Console.ReadLine();
            }
        }