“value ? is not a member of akka.actor.ActorRef”

I was trying to use a Future in Akka today and got the following error message:

value ? is not a member of akka.actor.ActorRef

It turns out you have to import the akka.pattern.ask to use ‘?’. There is a implicit conversion from ActorRef to AskableActorRef.

So add the following import and you should be set to go (take note that ask does not start with a capital:

import akka.pattern.ask

Leave a Reply

Your email address will not be published. Required fields are marked *