Florian Hopf / @fhopf

Ein Beispiel:

Einfacher Web Crawler in Java

Sequentiell

Zeitmessung


5404 [main] INFO de.fhopf.akka.Executor - Found 77 results
                    

(Kein echtes Benchmarking)

Scale Up

Synchronize and Suffer

Actor-Toolkit

Scala

SimpleActorMaster.java


class SimpleActorMaster extends UntypedActor {

    private final ActorRef indexer;
    private final ActorRef parser;

    public SimpleActorMaster(final PageRetriever pageRetriever, 
                            final IndexWriter indexWriter) {
       this.parser = getContext().actorOf(Props.create(
                                                PageParsingActor.class, 
                                                pageRetriever));
       this.indexer = getContext().actorOf(Props.create(
                                                IndexingActor.class, 
                                                new IndexerImpl(indexWriter)));
     } 
}
                    

PageParsingActor.java


public void onReceive(Object o) throws Exception {
    if (o instanceof String) {
        PageContent content = pageRetriever.fetchPageContent((String) o);
        getSender().tell(content, getSelf());
    }
}
                    

Zeitmessung


5847 [main] INFO de.fhopf.akka.Executor - Found 77 results                    
                    

Go Parallel

ParallelMaster.java


public ParallelMaster(final Indexer indexer, final PageRetriever pageRetriever) {
    parser = getContext().actorOf(Props.create(PageParsingActor.class, pageRetriever)
            .withRouter(new RoundRobinRouter(10)));
    indexingActor = getContext().actorOf(Props.create(IndexingActor.class, indexer));
}
                    

Zeitmessung


2315 [main] INFO de.fhopf.akka.Executor - Found 77 results                    
                    

Skalierbarkeit

Wartbarkeit

Supervision

Remoting/Cluster

akka-persistence

...

Ressourcen

Ressourcen