示例#1
0
 public DemoClient(BrokerActor <int> aBroker)
 {
     foreach (var item in Enumerable.Range(1, 10))
     {
         // aBroker.SendMessage(String.Format("Start Job {0}",item));
         aBroker.SendMessage(item);
     }
 }
示例#2
0
 public Extractor(ITransactionScraper transactionScraper,
                  IPortfolioScraper portfolioScraper,
                  BrokerActor brokerActor)
 {
     _transactionScraper = transactionScraper;
     _portfolioScraper   = portfolioScraper;
     _brokerActor        = brokerActor;
 }
示例#3
0
 public void BrokerActorTest()
 {
     TestLauncherActor.Test(
         () =>
     {
         EnumerableActor <string> memLogger = new EnumerableActor <string>();
         IActor broker = new BrokerActor <string>();
         Enumerable.Range(1, 10).All((t) =>
         {
             IActor worker = new WorkerActorTestString(memLogger);
             broker.SendMessage(BrokerAction.RegisterWorker, worker);
             return(true);
         });
         Enumerable.Range(1, 10).All(t =>
         {
             string s = string.Format(CultureInfo.InvariantCulture, "Test range {0}", t);
             broker.SendMessage(s);
             return(true);
         });
         Task.Delay(5000).Wait();
         Assert.AreEqual(10, memLogger.Count);
     });
 }