Closed kmruiz closed 5 years ago
@kmruiz This should be fixed/improved by some changes in both io.vlingo.common.BasicCompletes
as well as io.vlingo.actors.Stage
and io.vlingo.actors.DirectoryScannerActor
. Please confirm. If it is not fixed please provide a test that fails so I can make it green.
The main "fix" here is in part to recognize that a null
is always a failure value. If there is any code that considers null
to be a valid outcome it must be changed to provide a different value of the T
type.
We can assume that null will be always a failure. For representing an abscense of a value, we can use Optional
Implemented maybeActorOf()
that returns Completes<Optional<T>>
.
We can close it then 👍 . Thanks!
Right now, it's returning a null value that is hard to handle because you can have either null or an actor reference. With the current BasicCompletes implementation, if any of the andThen, andThenTo steps fail with a NPE, neither otherwise or recoverFrom are called. During a HTTP Request, the client wouldn't get any answer.
How to reproduce
otherwise
orrecoverFrom