Giter Site home page Giter Site logo

actorpatterndemo's Introduction

#Distributed Message Passing System

Getting Started

It is recommended to run this project in IntelliJ. When starting up this project in IntelliJ, directories need to be labeled properly. To do this, do the following:

Right click on src/main/scala and select Mark Directory as -> Sources Root. Similarly, under src, mark the test directory as Test Sources Root. One last thing: under src/multi-jvm unmark scala as Test Sources Root. This needs to to unmarked because when running tests, IntelliJ will try to run the integration tests which should only be ran via SBT.

Running the Project

To run the project, make sure that all dependencies have been downloaded by SBT. Then if you are using IntelliJ, right-click src/main/scala/ClusterApp and select Run ClusterApp. Make sure to have src/main/scala marked as Source Root before you do this!

Now that the cluster is running, the fastest way to present the data (other than the cluster logs) is to donwload the Dark WebSocket Terminal Chrome Extension. Once you have this chrome extension downloaded, run it and in the Dark WebSocket Terminal, enter the following command (when running in a dev environment):

/connect ws://localhost:9000/ws/workers-exchange?nodeId=1

The nodeId GET parameter specifies which PI node you wish to monitor. If the node does not exist, you will not get a connection. By default, there are three nodes, so nodeId 1,2,3 should all work.

You can also check to see if the server is alive and willing to work with WebSockets by connecting to the following route:

/connect ws://localhost:9000/ws/echo

##Integration Tests: In Akka, integration tests are tests that are ran on multiple JVMs to simulate multiple nodes in a cluster. All integration tests must be under src/main/multi-jvm and often need their own configuration.

####IntelliJ Setup Go to Run->Edit Configurations and add a new SBT task. Call it whatever you want. Under Tasks, enter multi-jvm:test. You should now be able to run this task to run integration tests.

####Standard Setup Install SBT and execute the following from the SBT command line:

> multi-jvm:test

##Unit tests: If you are using IntelliJ, mark the test directory as "Test Sources Root" and run the tests just like you would for any other scala test.

##Serialization Protobufs (Google protocol buffers) were used so that data models can be sent as messages between different platforms. In order to run the project and tests properly, the protobufs need to be compiled.

ScalaPB is used to compile the protobufs into Scala classes and objects as protobufs do not natively support Scala. You can find this dependency in project/plugins.sbt.

###How do I compile my protobufs in Scala?

If you do not have SBT installed on your system, go download it. Once you have SBT installed, run the following on the SBT command line:

> protobuf:protobufGenerate

Once compiled, the generated models should appear under src/main/generated

Note: It is important to notice that this command will not work on the SBT that ships with IntelliJ because certain classes depend on generated protobuf models and IntelliJ will complain that there are missing classes (thus not running the compile task).

actorpatterndemo's People

Contributors

pannellr avatar

Watchers

 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.