Remove samples (#22288)

Add code, that was used for documentation to the appropriate projects
or akka-docs.
This commit is contained in:
Martynas Mickevičius 2017-02-14 13:10:23 +02:00 committed by Johan Andrén
parent b8cdcf3439
commit 958de6a916
373 changed files with 1201 additions and 17259 deletions

View file

@ -0,0 +1,30 @@
package docs.cluster;
import java.util.HashMap;
import java.util.Map;
import akka.actor.UntypedActor;
//#worker
public class StatsWorker extends UntypedActor {
Map<String, Integer> cache = new HashMap<String, Integer>();
@Override
public void onReceive(Object message) {
if (message instanceof String) {
String word = (String) message;
Integer length = cache.get(word);
if (length == null) {
length = word.length();
cache.put(word, length);
}
getSender().tell(length, getSelf());
} else {
unhandled(message);
}
}
}
//#worker