[2.0.4-scala] play.api.libs.iteratee.Enumerator.fromFile and large file

81 views
Skip to first unread message

Anatoly Vinogradov

unread,
Nov 9, 2012, 2:54:17 AM11/9/12
to play-fr...@googlegroups.com
Enumerator.fromFile uses Enumerator.fromCallback that includes method step(it: Iteratee[E, A]) (in method apply). Method "step" is recursive but isn't tail-recursive so large file can throw OutOfMemory exception, can't it?
I'd like to implement enumerator that can wait for data in some file (e.g. log file). It will periodically check file and sends Input.Empty in Iteratee if new data isn't available. But if I make a similar implementation of enumerator it won't work in a limited amount of memory. Is there the better decision?

James Roper

unread,
Nov 9, 2012, 11:06:12 PM11/9/12
to play-fr...@googlegroups.com
I think this is fixed in 2.1.
Reply all
Reply to author
Forward
0 new messages