3 ms·
Play's documentation on iteratees is definitely dense. One of the contributors has posted a far better explanation (compared to the docs, not this post) on his
by saryant 13y ago
Play's documentation on iteratees is definitely dense. One of the contributors has posted a far better explanation (compared to the docs, not this post) on his blog:
http://mandubian.com/2012/08/27/understanding-play2-iteratees-for-normal-humans/ http://mandubian.com/2012/08/27/understanding-play2-iteratee...
I have an weekend project that uses Play's iteratees and enumerators quite well (IMO). They act as plumbing between client events (interacting with an embedded map), fetching and writing data to Mongo and interacting with the FlightAware API. I used server-sent events instead of WebSockets.
I haven't touched the code in a while (and the API key in the repo doesn't work ;)) but I have a working prototype that tries to stay entirely async: https://github.com/ryantanner/flightsight/tree/master/app https://github.com/ryantanner/flightsight/tree/master/app
I think the OP is correct in that Play's iteratees/enumerators are fantastic but too low-level for most applications. Play (or a third-party) need to provide a high-level abstraction so that developers can ramp up as quickly as with socket.io.
- curun1r 13y agoPerhaps you can clear up my confusion with the article. It appears to me that Play is basically implementing Rx, except with a pointless new set of terminology. The Node examples could have all been structured almost identically to the Play examples if they used rx. What advantages or extra functionality is enabled by enumerator/enumeratee/iteratee that you can't get with observable?
- saryant 13y agoshrug I'm not familiar with Rx nor did I name these things. If you're really curious, I'd ask on the mailing list. The devs are pretty quick to respond. https://groups.google.com/forum/#!forum/play-framework https://groups.google.com/forum/#!forum/play-framework
- tilltheis 13y agoPlay didn't invent the iteratee concept, Oleg Kiselyov did (http://okmij.org/ftp/Streams.html http://okmij.org/ftp/Streams.html). I asked myself the same question, as I'm doing the reactive programming course on Coursera, where Rx was the topic of the last couple weeks. I came to the conclusion that Rx focuses on side-effects while iteratees concentrate on iterative calculations. Iteratees calculate a result while Rx-observers just perform side-effects. Maybe someone else can further elaborate on this topic.
- eeperson 13y agoA comment in the article, from one of the Play developers, provides a good explanation about what iteratees provide that is not provided by rx: http://brikis98.blogspot.com/2013/11/play-scala-and-iteratees-vs-nodejs.html?showComment=1385511897410#c3240399653494822522 http://brikis98.blogspot.com/2013/11/play-scala-and-iteratee...
- rossjudson 13y agoQuoting Roper: The complexity of iteratees comes because they handle many different things at once - async io, backpressure, producing results, composition on multiple different axes. Most other APIs that they get compared to only handle one or max two of these, so the complexity of those APIs is not in what they do, but what they don't do that you have to implement yourself.