public DemoClient(BrokerActor <int> aBroker) { foreach (var item in Enumerable.Range(1, 10)) { // aBroker.SendMessage(String.Format("Start Job {0}",item)); aBroker.SendMessage(item); } }
public Extractor(ITransactionScraper transactionScraper, IPortfolioScraper portfolioScraper, BrokerActor brokerActor) { _transactionScraper = transactionScraper; _portfolioScraper = portfolioScraper; _brokerActor = brokerActor; }
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); }); }