My monitor is still a little too low. I guess I need to write a few more books.
This is an excerpt from my book, Hello, Scala. In this lesson I’ll show two examples of applications that use Akka actors, both of which can help you get started with my larger “Alexa written with Akka” = Aleka application.Back to top
An Akka “Hello, world” example
First, let’s look at an example of how to write a “Hello, world” application using Akka.
Writing a “Hello” actor
An actor is an instance of the
akka.actor.Actor class, and once it’s created it starts running on a parallel thread, and all it does is respond to messages that are sent to it. For this “Hello, world” example I want an actor that responds to “hello” messages, so I start with code like this:
Note: The print version of Hello, Scala on Amazon will be going up to $20 (USD) this Saturday, April 13, 2019. It’s currently just $10, so you know, buy it while it’s on sale and all that. :)
If you like free things, here’s a link to a free preview (PDF) of the new version of my book, “Hello, Scala.” The book is 257 pages long, and the free preview contains the first 120 pages of it, so I hope it’s a significant preview.
July, 2019 Update: Hello, Scala was previously available in PDF and Kindle versions, but hopefully there are some big changes coming, so those versions are no longer for sale.
Sorry I haven’t written much this week, I’ve been working on designs for the cover of a new book. But I can share one thing, my favorite song of the week, We Said Hello, Goodbye (Don’t Look Back), by Phil Collins. Some of the lyrics:
Well it really don’t matter much where you are
’cause home is in your heart
It’s a feeling that you wake with one day
Some people keep running all of their life
And still find they haven’t gone too far
They don’t see it's the feeling inside
The feeling inside.
March 5, 2019: For a limited time only, I put the paperback version of “Hello, Scala” on sale for $10 (US) on Amazon.
P.S. - It won’t get any cheaper than this.
July, 2019: Hello, Scala, is now available only in print form:
It was previously available in PDF and Kindle format, but there are some big changes planned, so those versions have been removed for the time being.
As the subtitle of the book shows, the purpose of this book is to help you learn the Scala programming language with small, easy lessons. The book consists of a little over 50 lessons, and it’s 258 pages long.
A new Kindle version of my book, Hello, Scala, is now available. This update includes new chapters, new content within chapters, and small corrections to the previous version.
The paperback version of “Hello, Scala” is now available. The regular price of the book will be $25, but it’s introductory price is $17.76. Click here to view the book information on Amazon.
The PDF version of Hello, Scala is now available here on Gumroad.com. The regular price will be $20, but it’s currently on sale for just $10.