akka-bootcamp icon indicating copy to clipboard operation
akka-bootcamp copied to clipboard

Lesson 1.5 does not provide option to submit exit command.

Open woodpk opened this issue 4 years ago • 1 comments

With the changes in the console reader actor in lesson 5 unit 1, it seems the exit behavior has been removed. Is this intentional or accidental ? The console no longer reads / allows input after providing the file path and hitting enter.

woodpk avatar Jul 04 '21 00:07 woodpk

It looks like the FileValidatorActor should be changed to

        protected override void OnReceive(object message)
        {
            var msg = message as string;
            if (string.IsNullOrEmpty(msg))
            {
                _consoleWriterActor.Tell(new Messages.NullInputError("Input was blank. Please try again.\n"));

                Sender.Tell(new Messages.ContinueProcessing());
            }
            else
            {
                var vaild = isFileUri(msg);
                if (vaild)
                {
                    _consoleWriterActor.Tell(new Messages.InputSuccess($"Starting processing for {msg}"));
                    Context.ActorSelection("akka://MyActorSystem/user/tailCoordinatorActor").Tell(new TailCoordinatorActor.StartTail(msg, _consoleWriterActor));
                    // _tailCoordinatorActor.Tell(new TailCoordinatorActor.StartTail(msg, _consoleWriterActor));
                }
                else
                {
                    _consoleWriterActor.Tell(new Messages.ValidationError($"{msg} is not a existing URI on Disk.\n"));
                }
                Sender.Tell(new Messages.ContinueProcessing());
            }
        }

pyongary avatar Jun 29 '23 07:06 pyongary