2014-02-24 32 views

回答

5

您可以使用方法run,參數類型爲Iteratee[E, List[E]]得到Future[List[E]]

有方法getChunks,創建Iteratee[E, List[E]]

myEnumerator run Iteratee.getChunks 

你可以使用Iteratee.fold手工編寫Iteratee。如果你想保留元素的順序,你可以在List上使用reverse

myEnumerator run Iteratee.fold(List.empty[E]){ (l, e) => e :: l } map { _.reverse } 
+2

或者你可以使用'Iteratee.getChunks',它可以爲你做到這一點。 –

+0

@TravisBrown,謝謝,更新。 – senia