static void Main(string[] args) { var aggregatedRepository = new AggregatedRepository(); var facebookProducer = new FacebookProducer(); var twitterProducer = new TwitterProducer(); facebookProducer.SubscribeToUpdates(aggregatedRepository); twitterProducer.SubscribeToUpdates(aggregatedRepository); var client = new ClientConsumer(); aggregatedRepository.SubscribeToAggregatedUpdates(client); Thread.Sleep(3000); aggregatedRepository.StopConsuming(); Console.Read(); }
public FacebookConsumerActor(IActorRef repositoryActor, FacebookProducer producer) { _repositoryActor = repositoryActor; producer.SubscribeToUpdates(this); }