public Product AddItem(int basket, int product) { IActorRef basketManager = ActorSystem.ActorOf <ProductManagementActor>(ActorNames.BasketManager()); basketManager.Tell(new TakeProductMsg(product, basket)); return(new Product { ProductNumber = product }); }
public TanpActorSystem() { ActorSystem = ActorSystem.Create("TANP"); // initialize structure IActorRef productManager = ActorSystem.ActorOf <ProductManagementActor>(ActorNames.ProductManager()); IActorRef basketManager = ActorSystem.ActorOf <ProductManagementActor>(ActorNames.BasketManager()); // populate with hard coded test feed TestDataFeed.GetProducts().ForEach(m => productManager.Tell(m)); }
public void RemoveItem(int basket, int product) { IActorRef basketManager = ActorSystem.ActorOf <ProductManagementActor>(ActorNames.BasketManager()); basketManager.Tell(new ReturnProductMsg(product, basket)); }