Created on May 29, 2013, 2:04 p.m. by Hevok & updated on May 29, 2013, 2:04 p.m. by Hevok
###########
¶
Gene Actors
¶
###########
¶
¶
Gene-actors project is one of the core parts of Genes App.
¶
It includes actor system that is intended to serves all async communication between users
¶
(collaborative editing, chatting, webrtc routing etc.) of Genes App.
¶
Is also includes business logic that deals with messages, tasks, video routing, search lookups etc.
¶
¶
Current version
¶
================
¶
It is very early build. It contains Master and member akka actors.
¶
¶
¶
Getting started
¶
===============
¶
0. Make sure that you have latest versions of Scala and sbt ( http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html ) installed.
¶]
Be aware that Debian (Ubuntu/Mint) repositories usually contain old versions, so it is recommended to install Scala and sbt from official websites
¶
¶
1. Type the following sbt commands::
¶
¶
$ sbt test #to run tests and make sure that everything is working
¶
¶
This steps may take a while because sbt will download all lacking dependencies
¶
¶
¶
2. Generate Intellij IDEA project file.
¶
Although gene-actors is PlayFramework Module, use sbt to compile, and sbt gen-idea to generate project file.
¶
You should not use play and play idea commands at all::
¶
¶
$ sbt gen-idea #to generate Intellij IDEA project files
¶
¶
Structure
¶
=========
¶
As it follows from the name Gene-actors are based on Akka actors that run in an async mode.
¶
If you do not know anything about Akka and actors I advice you to look at http://akka.io/ and read about basic concepts.
¶]
Gene-actors currently consist of four main packages: org.denigma.actors, org.denigma.genes, org.denigma.quests, org.denigma.video
¶
org.denigma.actors is the basic one from which all others inherit.
¶
The structures of those packaged are very similar, it contains:
¶ * main actor
¶ * member actors
¶ * workers
¶ * models and messages
¶ * managers
¶
¶
Main actor
¶
==========
¶
Main actor is the actor that supervises (in akka terminology) and contains all other actors inside.
¶
¶
It does:
¶
¶
* establishes the connection
¶
* creates and supervises (in akka's meaning of this term) member actors
¶
* routes messages between actors (for instance with tellAll it broadcast chat messages and tasks to all members)
¶
* subscribes members and other actors to events with a help of MessageBus object
¶
¶
¶
It contains:
¶
¶
* members map where all member actors (see later) are stored as well as rooms
¶
* different worker actors that are responsible for different parts of the functionality
¶
¶
¶
¶
Member actors
¶
=============
¶
For each user the member actor is created. Member actor is responsible for getting user input, processing it, and sending the results back to the user.
¶
Each member actor contain a channel to push messages to the user and parse methods to parse JSON that he receives.
¶
Member actors usually are just an assembly from traits (that I call managers) they inherit from.
¶
Usually they simply concatinate receive and parse partial functions of their traits.
¶
Most of the time you work with that traits, "Member" classes is just a way to compose several traits together.
¶
¶
¶
Workers
¶
=======
¶
Workers are actors that serve specific purposes. For instance Genes actor works with suggestions and graphs
Comment on This Data Unit