mardi 17 janvier 2017

akka actor: Patterns.pipe for Either

I have a method like this:

def myFuture: Future[Either[MyLeft, MyRight]] = Future {
.
.
.
}

If I want to pipe the result, I use:

Patterns.pipe(myFuture,ec).to(destinationActor)

But I want in case of Left , send result to one actor and in case of Right send result to another actor. pseudo code like this:

MyPatterns.eitherPipe(myFuture,ec).to(leftConsumerActor,rightConsumerActor)

Aucun commentaire:

Enregistrer un commentaire