Beispiel #1
0
        protected void CreateNewOrder(OrderCreated message)
        {
            var newActor = Context.ActorOf(OrderActor.Props(message.OrderId, message.CustomerId));

            Context.Watch(newActor);
            _actorsToOrders[message.OrderId] = newActor;
        }
Beispiel #2
0
        protected IActorRef GetExistingOrderActor(IOrderMessage message)
        {
            if (_actorsToOrders.ContainsKey(message.OrderId))
            {
                return(_actorsToOrders[message.OrderId]);
            }

            return(Context.ActorOf(OrderActor.Props(message.OrderId)));
        }