forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Env.scala
38 lines (30 loc) · 841 Bytes
/
Env.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package lila.pool
import scala.concurrent.duration._
import akka.actor._
final class Env(
lobbyActor: ActorSelection,
system: akka.actor.ActorSystem,
onStart: String => Unit
) {
private lazy val hookThieve = new HookThieve(lobbyActor)
lazy val api = new PoolApi(
configs = PoolList.all,
hookThieve = hookThieve,
gameStarter = gameStarter,
system = system
)
private lazy val gameStarter = new GameStarter(
bus = system.lilaBus,
onStart = onStart,
sequencer = system.actorOf(Props(
classOf[lila.hub.Sequencer], none, 10.seconds.some, logger
), name = "pool-sequencer")
)
}
object Env {
lazy val current: Env = "pool" boot new Env(
lobbyActor = lila.hub.Env.current.actor.lobby,
system = lila.common.PlayApp.system,
onStart = lila.game.Env.current.onStart
)
}