Creating an Enumeratee from a stateful algorithm
问题 I have a stateful algorithm that incrementally takes input and incrementally produces output. The inputs and outputs are unrelated in number; i.e. an input may produce zero or more outputs. I am attempting to turn it into an Enumeratee in the Play Framework, but I am having difficulty getting started. My algorithm has local mutable state and synchronous operations and looks something like this var state = 'foo var i = input() while (i != null) { if (state == 'foo && i >= 0) { // 2 outputs,