Exemple #1
0
        public async Task ReceiveAsync(IContext context)
        {
            if (context.Message is Started)
            {
                _logger.LogInformation($"{nameof(RequestActor)} ID='{context.Self.Id}' has started.");
                _actorManager.RegisterChildActor(new UserActor(_persistenceProvider, ActorNames.UserActor, _tracer, _loggerFactory), ActorNames.UserActor, context);
            }
            if (context.Message is UserMessage message)
            {
                var userActor = _actorManager.GetChildActor(ActorNames.UserActor, context);
                var userEvent = await context.RequestAsync <UserEvent>(userActor, message, _childActorTimeout);

                context.Respond(userEvent);
            }
        }