Welcome to my randomly updated blog with bits and pieces of Scala, Akka etc.
Recent Posts
Writing a Daytime Server with Akka Streams
Inspired by this article which shows how to implement a daytime server with swift NIO I thought I’d show how do the same on top of Akka in Scala.
Prerequisites To follow this little guide you are expected to have a JDK installed and sbt the Scala build tool. If you do not, start with getting those installed: https://www.scala-sbt.org/1.x/docs/Setup.html
Creating a project In a suitable directory, create a new project from the sbt akka-quickstart template: $ sbt new akka/akka-quickstart-scala.
read more
Chat With Akka HTTP Websockets
This is an update of an older article using the new MergeHub and BroadcastHub that was introduced in Akka Streams 2.4.10 instead of actors for the dynamic registration of clients. If you are after modelling the chat room and users with actors the old article is still relevant!
Something that often comes up in the various Akka community channels is people who want to create a HTTP chat application but get stuck, they often get stuck on the same thing, so let us go through how one could build such a thing.
read more
Actor per Request With Akka Http
Akka HTTP is the continuation of Spray, which used to be the web server implemented on top of Akka. A common pattern from Spray that devs want to implement with Akka HTTP is “actor per request” where each request is sent to an actor whose life cycle is bound to the request, so it is started, gets the request, does some processing and produces a complete or failed result back to the HTTP client.
read more