stop

How to stop Akka Actors (Scala)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 13.6, “How to stop Akka Actors.”

Back to top

Problem

You want to stop one or more running Akka actors.

Back to top

Solution

There are several ways to stop Akka actors. The most common ways are to call system.stop(actorRef) at the ActorSystem level or context.stop(actorRef) from inside an actor.

There are other ways to stop an actor:

Table of Contents

  1. Problem
  2. Solution
Back to top

How to kill an app on iOS 7

To kill an app on iOS 7, follow these two simple steps:

1) First, press the Home button twice. (Double-press it.) This changes your iPhone display to something like the following image, showing a list of apps that are running, with your most recent app shown first:

2) Next, select the large image of the app you want to stop/kill, and drag it up and off the screen, as shown in this image:

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:

How to gracefully restart Nginx

Nginx FAQ: How do I gracefully restart Nginx?

This used to be harder, but these days all you have to do is run this command:

$ sudo service nginx restart

Note that you will probably want to make sure your configuration is correct with this command before running that command:

$ nginx -t

AppleScript dialog icons

AppleScript dialog icons FAQ: How do I put icons on my AppleScript dialogs?

I started to get into this a little bit in my earlier "How to customize AppleScript dialogs" tutorial, but in this article I thought I'd just dig into the AppleScript dialog icons details.

AppleScript dialog icons - The "with icon" syntax

In short, you add icons to your AppleScript dialog using the AppleScript "with icon" syntax. Here are a few simple examples.

First, the AppleScript dialog note icon:

How to control iTunes from the keyboard on Mac OS X

iTunes Question: Is there a way to control iTunes from the keyboard when using Mac OS X?

Answer: Yes, there is a nice (and free) little program named Sizzling Keys that lets you control iTunes even when iTunes is minimized, hidden, or being displayed in another Space in the Mac OS X operating system. Just download and install Sizzling Keys, and select the key combinations you want to use to control iTunes.

My Windows Ant/Tomcat web application build process

I don't like the off-the-shelf process of developing web applications with Ant and Tomcat on Windows computers. Rather than get into my angst, here's the way I think the Ant build process should work with Tomcat: