Posts

Showing posts with the label scala

Simple wallboard display with Scala and Lift at GBIF

This week we hit 300 million indexed occurrence records. As you can see in the picture  we have got a monitor set up that shows us our current record count. It started as an idea a few weeks ago but while at the Berlin Buzzwords conference (we were at about 298 million then) I decided it was time to do something about it. I've been playing around with Scala  a bit in the last few months so this was a good opportunity to try Lift , a web framework written in Scala. In the end it turns out that very little code was needed to create an auto-updating counter. There are three components: We've got a DBUpdater object that uses Lift's Schedule  (used to be called ActorPing which caused some confusion for me) to update its internal count of raw occurrence records every ten seconds. The beauty is that there is just one instance of this no matter how many clients are looking at the webpage. The second part is a class that acts as a Comet adaptor called RawOccurrenceRecordCo...