Slide 38
Slide 38 text
Example
Compose service calls
val userRepo: Service[Long, User] = ...
val profileRepo: Service[User, Profile] = ...
val postRepo: Service[User, Seq[Post]] = ...
userRepo(userId).flatMap { user =>
Future.join(
profileRepo(user),
postRepo(user)
).map { (profile, posts) =>
renderResponse(profile, posts)
}
}
αʔϏεͷ݁Ռ'VUVSF͔ͩΒɺݺͼग़͠Λ࣍ʑ߹Ͱ͖Δɻ