remove router actor
parent
7052802a9e
commit
c66e6d9a0d
|
@ -13,7 +13,6 @@ final class Env(
|
|||
val CliUsername = config getString "cli.username"
|
||||
|
||||
private val RendererName = config getString "app.renderer.name"
|
||||
private val RouterName = config getString "app.router.name"
|
||||
private val WebPath = config getString "app.web_path"
|
||||
|
||||
lazy val bus = lila.common.Bus(system)
|
||||
|
@ -50,12 +49,6 @@ final class Env(
|
|||
|
||||
system.actorOf(Props(new actor.Renderer), name = RendererName)
|
||||
|
||||
system.actorOf(Props(new actor.Router(
|
||||
baseUrl = Env.api.Net.BaseUrl,
|
||||
protocol = Env.api.Net.Protocol,
|
||||
domain = Env.api.Net.Domain
|
||||
)), name = RouterName)
|
||||
|
||||
lila.log.boot.info("Preloading modules")
|
||||
lila.common.Chronometer.syncEffect(List(Env.socket,
|
||||
Env.site,
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package lila.app
|
||||
package actor
|
||||
|
||||
import lila.hub.actorApi.router._
|
||||
import lila.i18n.I18nDomain
|
||||
|
||||
import akka.actor._
|
||||
import akka.pattern.{ ask, pipe }
|
||||
import controllers.{ routes => R }
|
||||
|
||||
// returns String urls, not Call objects
|
||||
private[app] final class Router(
|
||||
baseUrl: String,
|
||||
protocol: String,
|
||||
domain: String) extends Actor {
|
||||
|
||||
import makeTimeout.large
|
||||
|
||||
def receive = {
|
||||
|
||||
case Abs(route) => self ? route map {
|
||||
case route: String => baseUrl + route
|
||||
} pipeTo sender
|
||||
|
||||
case Nolang(route) => self ? route map {
|
||||
case route: String => noLangBaseUrl + route
|
||||
} pipeTo sender
|
||||
|
||||
case TeamShow(id) => sender ! R.Team.show(id).url
|
||||
case Pgn(gameId) => sender ! R.Export.pgn(gameId).url
|
||||
case Puzzle(id) => sender ! R.Puzzle.show(id).url
|
||||
|
||||
case msg => sender ! Status.Failure(new Exception(s"No route for $msg"))
|
||||
}
|
||||
|
||||
private lazy val noLangBaseUrl = protocol + I18nDomain(domain).commonDomain
|
||||
}
|
|
@ -55,7 +55,6 @@ app {
|
|||
debug = false
|
||||
}
|
||||
renderer.name = "renderer"
|
||||
router.name = "router"
|
||||
web_path = "public"
|
||||
casual_only = false
|
||||
}
|
||||
|
@ -614,7 +613,6 @@ hub {
|
|||
search = ${teamSearch.actor.name}
|
||||
}
|
||||
messenger = ${message.actor.name}
|
||||
router = ${app.router.name}
|
||||
fishnet = ${fishnet.actor.name}
|
||||
tournament.api = ${tournament.api_actor.name}
|
||||
timeline {
|
||||
|
|
|
@ -13,7 +13,6 @@ final class Env(config: Config, system: ActorSystem) {
|
|||
val forumSearch = select("actor.forum.search")
|
||||
val teamSearch = select("actor.team.search")
|
||||
val messenger = select("actor.messenger")
|
||||
val router = select("actor.router")
|
||||
val fishnet = select("actor.fishnet")
|
||||
val tournamentApi = select("actor.tournament.api")
|
||||
val simul = select("actor.simul")
|
||||
|
|
|
@ -142,14 +142,6 @@ package notify {
|
|||
case class Notified(userId: String)
|
||||
}
|
||||
|
||||
package router {
|
||||
case class Abs(route: Any)
|
||||
case class Nolang(route: Any)
|
||||
case class TeamShow(id: String)
|
||||
case class Pgn(gameId: String)
|
||||
case class Puzzle(id: Int)
|
||||
}
|
||||
|
||||
package forum {
|
||||
case class MakeTeam(id: String, name: String)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue