akka

A 'Ping Pong' Scala Akka actors example

Akka actors FAQ: Can you share an "Akka Actors 101" example (a simple "Introduction to Akka Actors" example)?

Sure. If you're looking for a really simple tutorial, check out my Akka Actors "Hello, world" tutorial. If that one is overly simplified and you want something more, continue on here.

Who's using Scala? (March, 2013)

Who's using Scala? With the recent blog post by LinkedIn (LinkedIn is using the Play Framework), showing that they're using the Play Framework, I thought I'd take a quick look at who we know is using Scala these days.

According to the Scala in the Enterprise page (and general knowledge), the following companies are using Scala:

Wanted: Scala Cookbook reviewers

UPDATE: I originally posted this article in January, 2013, and it's now mid-February, 2013, and we're no longer looking for reviewers. I've only kept this page here so people won't get 404 errors.

OLD CONTENT:

Interested in being a reviewer for the Scala Cookbook?

Making a web service request with a timeout from a Play Framework Controller

My original "Day 1 with Play web services" code is shown a few paragraphs below, but on Day 2, the following code looks like an easier solution to the problem, courtesy of this web page:

Making Twitter web service calls concurrently with Akka Futures

While I was working on improving how Sarah gets information from Twitter and other sources, I decided to take some of that code and hack together this example. It shows how to make three Twitter web service requests concurrently -- and then wait for ther results before moving on -- with Akka Futures.

Before sharing the entire class, the cool Akka Futures stuff is in these lines of code:

Scala - A simple working Akka Futures example

Akka Futures FAQ: Can you share a simple example that shows how to use an Akka Future?

Sure. To fix a problem in my Sarah application I needed to be able to run some operations concurrently. After digging through the Akka Actors documentation I found that you can run simple operations as a Future, almost as easily as this:

An Akka actors 'ask' example - ask, future, await, timeout, duration, and all that

Akka actor ask FAQ: Can you share an example that shows how one Akka actor can ask another actor for information?

Sure. Here's a quick example to demonstrate how one Akka actor can ask another Akka actor for some information and wait for a reply. When using this "ask" functionality, you can either use the "ask" method, or the "?" operator, and I've shown both approaches below.

How to stop an Akka actor (and shutdown the Akka system)

Akka actor FAQ: How do you stop an Akka actor?

I don't have time this morning to write my usual tutorial, so in short, if you want to stop an Akka actor, use code like this from inside your actor's receive method:

context.stop(self)

Or, if you want to shut down the Akka system, use the following code, again from inside the receive method of one of your actors:

Simple Scala Akka Actor examples (Hello, world examples)

Scala Actors FAQ: Can you share a Scala Akka Actors example/tutorial?

Sure. Most of the Scala Akka Actor tutorials I see jump right into the deep end, throwing you into some tough concepts right away. Personally I'm more into the "crawl before you walk approach", and to that end, here are some simple Akka Actor examples, of the "Hello, world" variety.

A simple Akka "Hello, world" example

My first Akka Actor example is about as simple as I can make it:

Syndicate content