<commit_before>package truerss.system

import akka.actor.{Actor, ActorLogging, Props}
import akka.io.IO

import scala.slick.jdbc.JdbcBackend.DatabaseDef
import spray.can.Http

import truerss.api.{WSApi, RoutingService}
import truerss.db.DbActor
import truerss.models.CurrentDriver

/**
 * Created by mike on 2.8.15.
 */
class SystemActor(dbDef: DatabaseDef, driver: CurrentDriver) extends Actor
  with ActorLogging {

  implicit val system = context.system

  val dbRef = context.actorOf(Props(new DbActor(dbDef, driver)), "db")

  val networkRef = context.actorOf(Props(new NetworkActor), "network")

  val sourcesRef = context.actorOf(Props(new SourcesActor(self, networkRef)), "sources")

  val proxyRef = context.actorOf(Props(new ProxyServiceActor(dbRef, networkRef, sourcesRef)), "proxy")

  val api = context.actorOf(Props(new RoutingService(proxyRef)), "api")

  val socketApi = context.actorOf(Props(new WSApi(8080)), "ws-api")

  IO(Http) ! Http.Bind(api, interface = "localhost", port = 8000)


  def receive = {
    case x => proxyRef forward x
  }

}<commit_msg>make network actor and service actor router<commit_after>package truerss.system

import akka.actor.{Actor, Props}
import akka.io.IO
import akka.routing.SmallestMailboxPool

import spray.can.Http
import scala.slick.jdbc.JdbcBackend.DatabaseDef

import truerss.api.{RoutingService, WSApi}
import truerss.db.DbActor
import truerss.models.CurrentDriver

/**
 * Created by mike on 2.8.15.
 */
class SystemActor(dbDef: DatabaseDef, driver: CurrentDriver) extends Actor {

  implicit val system = context.system

  val dbRef = context.actorOf(Props(new DbActor(dbDef, driver)), "db")

  val networkRef = context.actorOf(
    Props(new NetworkActor).withRouter(SmallestMailboxPool(10)), "network-router")

  val sourcesRef = context.actorOf(Props(new SourcesActor(self, networkRef)), "sources")

  val proxyRef = context.actorOf(Props(
    new ProxyServiceActor(dbRef, networkRef, sourcesRef))
      .withRouter(SmallestMailboxPool(10)), "service-router")

  val api = context.actorOf(Props(new RoutingService(proxyRef)), "api")

  val socketApi = context.actorOf(Props(new WSApi(8080)), "ws-api")

  IO(Http) ! Http.Bind(api, interface = "localhost", port = 8000)


  def receive = {
    case x => proxyRef forward x
  }

}
{'fraction_non_alphanumeric': 0.12003491924923614, 'fraction_numerical': 0.012221737232649499, 'mean_word_length': 5.047493403693931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4661983', 'n_tokens_mistral': 792, 'n_tokens_neox': 745, 'n_words': 176}