xnnn4a
Last Updated: February 25, 2016
·
1.629K
· raulraja

Play2 Scala Reactive Mongo Capped Collections and Iteratees

https://github.com/47deg/labs-scala-play-mongo

This demo showcases how Play2 has native built-in support for Comet and how you may use Iteratees to reactively handle data streams. It connects to the Twitter API, streaming tweets in real time and feeding the incoming stream asynchronously into a Mongo Collection.

The Mongo collection is a special type of collection, a capped collection that may be tailed in order to receive callback notifications when there are incoming records added to it.

We use Play Iteratees and Enumerators to consume and stream the collection back to the browser as new tweets are being inserted.