GithubHelp home page GithubHelp logo

actors's Introduction

Actors

A collection of actor-systems defined on akka by typesafe.

API Documentation

PreStart

> sbt clean

> sbt compile

Receive

actors.basic.typed : Akka Typed


  • An actor system (name = sanskaar) is setup, then the driver thread sends a message of type Pranam to the system decorated with Props using the โ€œaskโ€ pattern (represented by the ? operator)
> sbt "runMain org.shkr.actors.basic.typed.StaticActor"
 

basic.cluster.ClusterListener : Akka Cluster w/ Remote Actors


  • INTRODUCTION An akka Cluster provides a fault-tolerant decentralized peer-to-peer based cluster membership service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.
  • An actor system is linked to (name = "ClusterSystem") and the main method takes as input port number, then starts a Cluster Listener Remote Actor on that port and joins itself as member of the Cluster whose seed nodes are listed as :
          "akka.tcp://[email protected]:2551"
          ] ```
    in the [reference.conf](https://github.com/shkr/actors/tree/master/src/main/scala/org/shkr/actors/basic/cluster/conf/reference.conf) file;      
    
> sbt "runMain org.shkr.actors.basic.cluster.ClusterListener 2551"  
 # This creates a ClusterListener Remote actor which registers itself as the first seed node of the Akka Cluster
cluster.transformation.{Frontend, Backend} : Modified Worker Dial-in Example

> sbt "runMain org.shkr.actors.basic.cluster.transformation.Frontend 2552 1" 
 # This creates a Frontend Remote actor; The main method also schedules a TransformationJob
   The ActorSystem on this node for each 2 second interval sends a Job to the Frontend Actors on this node
   in RoundRobin
> sbt "runMain org.shkr.actors.basic.cluster.transformation.Backend 2553 2"  
 # This creates a two Backend Remote actor which registers itself and listens to MemberUp events;
   In addition it informs the TransformationFrontend that it has registered itself, and does the
   any TransformationJob sent to it;

play.diningphilosophers : A Play of the Dining Philisophers


  • An actor system is linked to (name = "DiningPhilisophers") and using a LocalActorRefProvider, we enact the Dining Philosophers.
  • The actor system is configured inside the Configuration object which specifies the thinkingTime, eatingTime and the playTime
> sbt "runMain org.shkr.actors.play.diningphilosophers.Stage"
> sbt "runMain org.shkr.actors.play.diningphilosophers.Stage 8 4"

actors.persistence : Akka Persistence


  • Ledger Example
  • An actor system is created, and a Ledger Actor is intantiated to which some random transactions is sent. At the end of which we save a snapshot and print the current-time state of the Ledger
  • The persistence plugin is configured to use Cassandra. The LevelDB and Local FileSystem which is available as part of akka-persistence can also be used. In order to do that Configuration has to be modified.
> sbt "runMain org.shkr.actors.persistence.Ledger Sonia"

actors's People

Contributors

shkr avatar

Watchers

 avatar  avatar  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.