Actors using Scala & Akka — Part 1 : Introduction

A quick guide to get started with akka actors with scala for beginners

Akka with scala

IDE & Project Setup

Scala plugin
New project
Scala — SBT
Project Configuration
Loading project
build.sbt
reload project

Main.scala

Main.scala
hello scalaProcess finished with exit code 0

Running from CLI

Running from CLI

Our first actor : A bank account

Protocol

BankAccountMessage.scala

Behaviour

Behaviour factory signature

Spawning actor

Actor Hierarchy
Actor[akka://MyBankActorSystem/system/account1#-822693343]

Sending messages

balance = 0
balance = 150

End of Part 1

Scala | Akka | Functional Programming | Distributed Systems

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store