1. A function calling async function should return a future too.
def foo (b: B) : Future[A] {
val c = aync {
...
}
2. access a future:
for {
s <- c
} yield {
...
}
}
3. change a list of future to future of list
Future.sequence(x)
4. wrap anything with Future:
sync(None)
No comments:
Post a Comment