I'm trying to make an async call to different sub-actors, such as:

```
A ---> B ---> C
        \---> D

```

Actor A sends a request message to Actor B and B send two task messages to C and D, when C and D send the results back, B merge the results up and send it back to the A.

I was trying to use ask pattern and onSuccess to solve this:

```
class B(fakeInterface: String, subInterface: Array[ActorRef]) extends Actor {

val subCount = subInterface.length
var finishCount = 0

def receive = {
  case reqMsg(msg) =>

    if (subInterface.length == 0){
      sender ! DoneMessage(msg)
    } else {
      implicit val timeout = Timeout(5 minutes)
      val composedFutures = subInterface map { x =>
        (x ? DoItMessage(msg)).mapTo[DoneMessage]
      }

      val allResult = Future.sequence(composedFutures)
      allResult.onSuccess {
        case _ => sender ! DoneMessage(msg)
      }
    }
  }
}

```

But the code above does not compile at all, I got three error:

```
[error] inferred type arguments [dummy.DoneMessage,Array] do not conform to method sequence's type parameter bounds [A,M[_] <: TraversableOnce[_]]
[error]         val allResult = Future.sequence(composedFutures)
[error]                                ^
[error]  type mismatch;
[error]  found   : Array[scala.concurrent.Future[dummy.DoneMessage]]
[error]  required: M[scala.concurrent.Future[A]]
[error]         val allResult = Future.sequence(composedFutures)
[error]                                         ^
[error]  Cannot construct a collection of type M[A] with elements of type A based on a collection of type M[scala.concurrent.Future[A]].
[error]         val allResult = Future.sequence(composedFutures)
[error]                                        ^
[error] three errors found

```

How can I fix this? Or is there a more proper way to solve this scenario?