예제 #1
0
        private void Do(Office office)
        {
            Console.WriteLine($"{Context.Self.Path} - {office.ID} : {office.Data}");
            var data = new OfficePnrList(office, Data.Pnrs);

            Thread.Sleep(2000);
            this.Sender.Tell(data);
        }
예제 #2
0
        private void CallBack(OfficePnrList officePnrList)
        {
            Console.WriteLine($"{officePnrList.Counter} WIP {officePnrList.Office.ID} ::: {officePnrList.Office.Data}");
            foreach (var pnr in officePnrList.Pnrs)
            {
                this.logger.Info(NLog.LogLevel.Info);
                this.pnrCounter++;
                var processor = Context.Child(pnr);
                if (processor == ActorRefs.Nobody)
                {
                    processor = Context.ActorOf(Props.Create(() => new Processor(pnr)), pnr);
                }

                processor.Tell(new Pnr(pnr));
            }
        }