How to get out value from Scala Future onComplete/onSuccess
问题 I have a high level structure of my code as follows. This is just an example replicating the high level structure.:- import scala.concurrent.Future class FutureReturnsAValue extends PersonAgeModifier { def main(args: Array[String]) { val jhonObj = Person("Jhon", 25) val punishmentResult = addAgeCurse(jhonObj) println("The punishment result for Jhonny is " + punishmentResult) } def addAgeCurse(person: Person): String = { val oldAge = person.age val futureAge = LongProcessingOpForAge(person)