Akka: Change an actor's behavior using context.become

Earlier, I've looked at the basics of Akka actors by creating a simple chatroom. Today I'm going to continue by looking at how we could change an actor's behavior using context.become by introducing the concept of a closed and open chatroom. Let's start by introducing a simplified version of…


Concurrency made easy with Scala and Akka

A few posts ago I looked at Erlang and how it solves concurrency using the actor model. I truly enjoyed playing with this strategy and found the concept intriguing. That's why i decided to look into how concurrency using actors is solved in other languages as well. In this post…


Scala Collections: Part 3 - Exploring more operations

In the final post of this series, we're going to continue to look at the variety of operations in the Scala Collection API. Let’s start with a few operations that builds on ideas we've already looked at. TakeWhile def takeWhile(p: (A) ⇒ Boolean): Traversable[A] Takes the longest prefix…


Scala Collections: Part 2 - A few basic operations

In the first part of this series, I went through the Scala Collections hierarchy and how it's put together. In following posts, I'll go through a lot of the operations you can use on collections. I will not cover all of them, so for a full overview, please take a…


Scala Collections: Part 1 - Overview of the hierarchy

One of the first things that impressed me with Scala was the Scala Collections. It's flexible and has a wide range of operations that makes it easy to work with different types of data. So to get more familiar with Scala Collections API, I've started this mini series. Here I'll…



Pattern matching in Scala

Pattern matching is a feature that is not unfamiliar in a lot of functional languages and Scala is no exception. It matches a value against several patterns. Each pattern points to an expression. The expression that is associated with the the first matching pattern, will be executed. The syntax of…