actor

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.

The Dos Equis 'most interesting man' was a Star Trek redshirt - and lived

The Dos Equis 'most interesting man' was a Star Trek redshirt - and lived!

 

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:

How to exit a Scala Actor (exit, quit, or terminate an Actor)

While working with a Scala Actor last night, I came across a situation where I wanted to be able to manually tell the Actor to quit/die/terminate.

It looks like the proper way to exit a Scala Actor is pretty simple:

UML Use Cases and a "List of Actors" diagram

As a business analyst, one of the things you have to do sometimes is organize your client's thinking. For instance, I've worked on several projects where clients didn't know anything about the Unified Modeling Language (UML), or thinking about projects in terms of Use Cases and Actors. As a result, they came up with some very elaborate diagrams in an attempt to explain their thinking.

A simple robustness diagram explains Model-View-Controller (MVC)

If you've never read the book Use Case Driven Object Modeling with UML by Doug Rosenberg and Kendall Scott you're missing one of the most simple and important Model-View-Controller (MVC) diagrams in the software business.

In their discussion of Robustness Diagrams they introduce a figure called "Robustness Diagram Rules" that succintly tells you how to implement an MVC design in your code. In one figure they tell you:

UML sequence diagram - how to show a web service call

I recently started to model an application that makes extensive use of web service calls, and my customer asked me to include a UML sequence diagram to show the flow of calls in the system. This prompted me to wonder, "What is the correct way to show distributed systems (like a web service) in a UML sequence diagram?"

If this link is correct, in a UML diagram you show remote systems as actors.

Syndicate content