Quantcast
Channel: Michael on development » Scala
Browsing latest articles
Browse All 9 View Live

Fun with Scala’s new Reflection API (2.10)

Scala 2.10 introduced a new reflection API (see here for an in-depth overview) which is much closer to the actual type system than the old Manifests were – in fact the compiler uses TypeTags itself....

View Article



Create your custom Scala REPL

If you ever need to create an interactive console/REPL that let’s users use play with your code in a simple terminal you might (still) find that there’s hardly any documentation. I fixed the console...

View Article

Akka work-pulling pattern to throttle work

At Movio we’re using Akka in more and more places – we love the Actor model for concurrency. This week we ran into a problem that I think more projects will face: we’ve got an Actor that produces work...

View Article

Akka TestKit addition: expect some messages, ignore others

Here’s an addition to Akka TestKit that might come in handy. It does what it says: you can give it a couple of messages that you’re expecting within a given duration (defaults to 3s). Unlike...

View Article

Callback lifter and exception driven development

Warning: do not try this at work! ;) We were hosting a code retreat at Movio yesterday, and one of the sessions had the constraint that none of your production methods may return anything. I checked...

View Article


scala.util.Try – chain to handle all success and error cases

scala.util.Try is pretty awesome and you should read Daniel’s introductory post if you don’t know it yet. I just ported some code from using exception handling to using Try: lines of code went down to...

View Article

Image may be NSFW.
Clik here to view.

Akka Work Pulling Pattern to prevent mailbox overflow, throttle and...

I just gave a talk about the Work Pulling Pattern at NY-Scala (slides), so I figured it’s a good time to update my previous article on the Work Pulling Pattern. It’s based on Derek Wyatt’s blog post...

View Article

Create generic Scala collections with CanBuildFrom

Normally if you write a function that takes a collection and returns a new collection that you create inside the function, you need to specify the concrete type of the collection. Otherwise, how are...

View Article


Execute Scala Futures in serial one after the other (non-blocking)

Scala’s Future implementation is really cool, it’s super easy to execute code in parallel, plus it’s very composable because it is a monad. As soon as you create a Future, it wanders off into a...

View Article

Browsing latest articles
Browse All 9 View Live




Latest Images