In Scala Akka futures, what is the difference between map and flatMap?

前端 未结 3 1372
遇见更好的自我
遇见更好的自我 2021-01-30 10:47

in normal Scala map and flatMap are different in that flatMap will return a iterable of the data flattened out into a list. However in the Akka documentation, map and flatMap se

3条回答
  •  萌比男神i
    2021-01-30 11:20

    Can someone please explain what is the difference between map and flatMap here in Akka futures?

    The type, basically:

    flatMap[A](f: T => Future[A]): Future[A] 
    
    map[A](f: T => A): Future[A] 
    

提交回复
热议问题