static void OnFeedEmailsRequest(FeedEmailsRequest message)
        {
            Console.WriteLine($"Feeding emails for split {message.SplitId}");

            Context.Sender.Tell(new FeedEmailsReply(message,
                Enumerable.Repeat(new Email("*****@*****.**", "Hello"), message.ToId - message.FromId + 1).ToList()));
        }
Exemplo n.º 2
0
 public FeedEmailsReply(FeedEmailsRequest request, IList<Email> emails)
 {
     SplitId = request.SplitId;
     Emails = emails;
 }
Exemplo n.º 3
0
        private void OnStartBatch(StartBatch message)
        {
            Console.WriteLine($"Starting batch {batchId}...");

            for (int i = 0; i < numberOfSplits; i++)
            {
                var feedEmailsRequest = new FeedEmailsRequest(i * NumberOfEmailsInSplit, (i + 1) * NumberOfEmailsInSplit - 1);
                pendingSplitIds.Add(feedEmailsRequest.SplitId);

                message.EmailFeeder.Tell(feedEmailsRequest);
                Console.WriteLine($"Split {feedEmailsRequest.SplitId} of batch {batchId} requested");
            }

            Become(AwaitingEmailFeeds);
        }