Giter Site home page Giter Site logo

akka-simple-dispatcher-sensorprocessor-temperaturesensor-'s Introduction

Description of message flows

We have 3 actor types; DispatcherActor, SensorProcessorActor, TemperatureSensorActor. We also added a new message type that isConfigMsg. DispatcherActor: We have two HashMap for Load Balancer, SensorCountsForLB and SensorToProcessorMap. SensorCountsForLB maps the processors to number of sensor they have assigned and SensorToProcessorMap handles the dispatcher act to which processor it should send the msg. For round robin we have one list(SensorToProcessorList) and one index that handles where are we inside our list. According to DispatchLogic Msg, we are changing the behavior of the actor. When it is RoundRobin and when a temperature message is received, we are incrementing currentProcessor to move forward in the list. In LoadBalancer,when a temperature message is received, the LoadBalancer checks if the corresponding sensor is already mapped to a processor. If it is, the message is forwarded to that processor. If not, it identifies the processor with the minimum message count, incrementally assigns the sensor to that processor, updates the message count, and then forwards the message to the chosen processor. when creating sesnors we send a ConfigMsg so they know the dispatcher. In the main, we crated sensors and dispatcher, also we use GenerateMsg type to tell the sensors that they .Sensors tells to dispatcher temperature info with TemperatureMsg. We also changed to RR and Loadbalancer and visaversa. For error handling we throw an exception in the Processor, the handler and master is the dispatcher (which has created them) it handles it with OneToOne and resumes after a failure.

akka-simple-dispatcher-sensorprocessor-temperaturesensor-'s People

Contributors

mehmetemreakbulut avatar

Watchers

 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.