GithubHelp home page GithubHelp logo

doytsujin / akkaactorsandfutures Goto Github PK

View Code? Open in Web Editor NEW

This project forked from logicaalternativa/akkaactorsandfutures

0.0 0.0 0.0 216 KB

akka by example

Home Page: http://www.logicaalternativa.com/akka-por-ejemplos/

Java 100.00%

akkaactorsandfutures's Introduction

akka by example

In this Java 8 project, examples are used to illustrate the most akka important concepts.

The tools are dummy implementations and Junit tests that allow for observation of the behavior of:

  • message queues
  • routers
  • types of sending messages
  • supervision strategies and actor life cycle
  • event bus
  • dead letters
  • typed actors

Tests

This is a Maven Java project. There are 16 Junit tests that can be run thanks to 'mvn' command:

How works the actor's mailbox?

mvn -Dtest=com.logicaalternativa.examples.akka.queue.ActorQueueTest test

How works a router?

mvn -Dtest=com.logicaalternativa.examples.akka.queue.ActorQueueRouteRoundRobinTest test

Different ways of sending messages between actors

Using 'forward'

mvn  -Dtest=com.logicaalternativa.examples.akka.message.ActorProxyTest#testForward test 

Using 'redirect'

mvn -Dtest=com.logicaalternativa.examples.akka.message.ActorProxyTest#testRedirectMessageToChild test

Using futures

mvn -Dtest=com.logicaalternativa.examples.akka.message.ActorProxyTest#testFutur test

Using 'await'

mvn -Dtest=com.logicaalternativa.examples.akka.message.ActorProxyTest#testAwaitFutur test

Fault resilience: supervision strategy.

Default strategy

mvn -Dtest=com.logicaalternativa.examples.akka.supervisorstrategy.ActorLetItCrashTestDefault test

Escalate exception

mvn -Dtest=com.logicaalternativa.examples.akka.supervisorstrategy.ActorLetItCrashTestEscalate test

'Resume' supervision strategy

mvn -Dtest=com.logicaalternativa.examples.akka.supervisorstrategy.ActorLetItCrashTestResume test

Stopping supervised actor

mvn -Dtest=com.logicaalternativa.examples.akka.supervisorstrategy.ActorLetItCrashTestStop test

How works the event bus?

mvn -Dtest=com.logicaalternativa.examples.akka.bus.PublishSimpleSubcribeTest test

Dead letters

mvn -Dtest=com.logicaalternativa.examples.akka.bus.DeadLettersTest test

Typed actors

Behavior when it's called a method that returns void

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpTest#testReturnVoidWithSleep test

and

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpExceptionsTest#testRuntimeExceptionVoid test

Behavior when it's called a method that returns a future

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpTest#testFutureEcho test

and

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpExceptionsTest#testRuntimeExceptionFuture test

Behavior when it's called a method that returns an object

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpTest#testEcho test

and

mvn -Dtest=com.logicaalternativa.examples.akka.typed.TypedActorDummyImpExceptionsTest#testRuntimeExceptionString test

M.E.

akkaactorsandfutures's People

Contributors

logicaalternativa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.