Revert "new actor map for round socket hub"

This reverts commit 05e7c16a9a.
deployFix
Thibault Duplessis 2018-08-26 06:34:08 +02:00
parent a27f56b208
commit 256c4bc8f3
11 changed files with 25 additions and 22 deletions

View File

@ -411,7 +411,7 @@ round {
ragequit.timeout = 10 seconds
}
socket {
name = round-socket-front
name = round-socket
timeout = 30 seconds
}
channel.move_time.name = round-move-time-channel

View File

@ -25,7 +25,7 @@ final class Env(
lazy val analyser = new Analyser(
indexer = indexer,
requesterApi = requesterApi,
roundSocket = hub.socket.roundActor,
roundSocket = hub.socket.round,
studyActor = hub.actor.study,
bus = system.lilaBus
)

View File

@ -14,7 +14,7 @@ final class Env(
lazy val gameStateStream = new GameStateStream(
system,
jsonView,
hub.socket.roundActor
hub.socket.round
)
lazy val player = new BotPlayer(hub.actor.chat)(system)

View File

@ -61,7 +61,7 @@ final class Env(
import lila.hub.actorApi.map.Exists
import akka.pattern.ask
import makeTimeout.short
hub.socket.roundActor ? Exists(id) mapTo manifest[Boolean]
hub.socket.round ? Exists(id) mapTo manifest[Boolean]
},
clientVersion = clientVersion,
offlineMode = OfflineMode,

View File

@ -35,7 +35,7 @@ final class Env(config: Config, system: ActorSystem) {
object socket {
val lobby = select("socket.lobby")
val roundActor = select("socket.round")
val round = select("socket.round")
val site = select("socket.site")
val hub = select("socket.hub")
}

View File

@ -54,7 +54,7 @@ object Env {
db = lila.db.Env.current,
system = lila.common.PlayApp.system,
getLightUser = lila.user.Env.current.lightUserSync,
roundSocketHub = lila.hub.Env.current.socket.roundActor,
roundSocketHub = lila.hub.Env.current.socket.round,
scheduler = lila.common.PlayApp.scheduler,
config = lila.common.PlayApp loadConfig "push"
)

View File

@ -1,7 +1,7 @@
package lila.round
import akka.actor._
import akka.pattern.ask
import org.joda.time.DateTime
import play.api.libs.iteratee._
import reactivemongo.api._
@ -15,7 +15,7 @@ import makeTimeout.short
private final class CorresAlarm(
coll: Coll,
socketHub: lila.hub.ActorMapNew
roundSocketHub: ActorSelection
) extends Actor {
object Schedule
@ -56,7 +56,7 @@ private final class CorresAlarm(
case (count, alarm) => GameRepo.game(alarm._id).flatMap {
_ ?? { game =>
val pov = Pov(game, game.turnColor)
socketHub.ask[Boolean](pov.gameId, IsOnGame(pov.color)) addEffect {
roundSocketHub ? Ask(pov.gameId, IsOnGame(pov.color)) mapTo manifest[Boolean] addEffect {
case true => // already looking at the game
case false => context.system.lilaBus.publish(
lila.game.actorApi.CorresAlarmEvent(pov),

View File

@ -1,14 +1,14 @@
package lila.round
import akka.actor._
import akka.pattern.{ ask, pipe }
import akka.pattern.ask
import com.typesafe.config.Config
import scala.concurrent.duration._
import actorApi.{ GetSocketStatus, SocketStatus }
import lila.game.{ Game, GameRepo, Pov }
import lila.hub.actorApi.map.{ Tell, Exists, Ask }
import lila.hub.actorApi.map.{ Ask, Tell }
import lila.hub.actorApi.round.{ Abort, Resign, FishnetPlay }
import lila.hub.actorApi.{ HasUserId, DeployPost }
@ -128,11 +128,6 @@ final class Env(
logger.warn("Disabling round history persistence!")
historyPersistenceEnabled = false
}
case Tell(id, msg) => socketHub.tell(id, msg)
case Exists(id) => sender ! socketHub.exists(id)
case Ask(id, msg) =>
import makeTimeout.short
socketHub.getOrMake(id) ? msg pipeTo sender
}
}), name = SocketName)
bus.subscribe(socketHubActor, 'tvSelect, 'startGame, 'deploy)
@ -237,7 +232,7 @@ final class Env(
)
bus.subscribe(system.actorOf(
Props(new CorresAlarm(db(CollectionAlarm), socketHub)),
Props(new CorresAlarm(db(CollectionAlarm), hub.socket.round)),
name = "corres-alarm"
), 'moveEventCorres, 'finishGame)

View File

@ -21,6 +21,7 @@ final class Env(
flood: lila.security.Flood,
hub: lila.hub.Env,
roundMap: DuctMap[_],
roundSocketHub: ActorSelection,
lightUserApi: lila.user.LightUserApi,
isOnline: String => Boolean,
onStart: String => Unit,
@ -216,6 +217,7 @@ object Env {
flood = lila.security.Env.current.flood,
hub = lila.hub.Env.current,
roundMap = lila.round.Env.current.roundMap,
roundSocketHub = lila.hub.Env.current.socket.round,
lightUserApi = lila.user.Env.current.lightUserApi,
isOnline = lila.user.Env.current.isOnline,
onStart = lila.game.Env.current.onStart,

View File

@ -2,7 +2,6 @@ package lila.tv
import akka.actor._
import com.typesafe.config.Config
import scala.concurrent.duration._
import lila.db.dsl._
import lila.game.Game
@ -12,7 +11,7 @@ import scala.concurrent.duration._
final class Env(
config: Config,
db: lila.db.Env,
renderer: ActorSelection,
hub: lila.hub.Env,
lightUser: lila.common.LightUser.GetterSync,
roundProxyGame: Game.ID => Fu[Option[Game]],
system: ActorSystem,
@ -26,12 +25,18 @@ final class Env(
private val selectChannel = system.actorOf(Props(classOf[lila.socket.Channel]), name = ChannelSelect)
private val tvActor = system.actorOf(
Props(new TvActor(renderer, selectChannel, lightUser, onSelect))
Props(new TvActor(hub.actor.renderer, hub.socket.round, selectChannel, lightUser, onSelect))
)
lazy val tv = new Tv(tvActor, roundProxyGame)
scheduler.message(FeaturedSelect) { tvActor -> TvActor.Select }
{
import scala.concurrent.duration._
scheduler.message(FeaturedSelect) {
tvActor -> TvActor.Select
}
}
}
object Env {
@ -39,7 +44,7 @@ object Env {
lazy val current = "tv" boot new Env(
config = lila.common.PlayApp loadConfig "tv",
db = lila.db.Env.current,
renderer = lila.hub.Env.current.actor.renderer,
hub = lila.hub.Env.current,
lightUser = lila.user.Env.current.lightUserSync,
roundProxyGame = lila.round.Env.current.roundProxyGame _,
system = lila.common.PlayApp.system,

View File

@ -10,6 +10,7 @@ import lila.game.{ Game, GameRepo }
private[tv] final class TvActor(
rendererActor: ActorSelection,
roundSocket: ActorSelection,
selectChannel: ActorRef,
lightUser: LightUser.GetterSync,
onSelect: Game => Unit