Skip to content

Commit

Permalink
inject RunPeriodically
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 20, 2024
1 parent a3158f3 commit 93e297c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
47 changes: 24 additions & 23 deletions src/main/scala/LilaWs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@ object LilaWs extends App:
given Scheduler = clientSystem.scheduler
given Executor = clientSystem.executionContext

lazy val mongo = wire[Mongo]
lazy val groupedWithin = wire[util.GroupedWithin]
lazy val lightUserApi = wire[LightUserApi]
lazy val lilaRedis = wire[Lila]
lazy val inquirers = wire[Inquirers]
lazy val roundCrowd = wire[RoundCrowd]
lazy val roomCrowd = wire[RoomCrowd]
lazy val crowdJson = wire[ipc.CrowdJson]
lazy val users = wire[Users]
lazy val keepAlive = wire[KeepAlive]
lazy val lobby = wire[Lobby]
lazy val socialGraph = wire[SocialGraph]
lazy val friendList = wire[FriendList]
lazy val stormSign = wire[StormSign]
lazy val lag = wire[Lag]
lazy val evalCache = wire[lila.ws.evalCache.EvalCacheApi]
lazy val services = wire[Services]
lazy val controller = wire[Controller]
lazy val router = wire[Router]
lazy val seenAt = wire[SeenAtUpdate]
lazy val auth = wire[Auth]
lazy val nettyServer = wire[netty.NettyServer]
lazy val monitor = wire[Monitor]
lazy val mongo = wire[Mongo]
lazy val groupedWithin = wire[util.GroupedWithin]
lazy val runPeriodically = wire[util.RunPeriodically]
lazy val lightUserApi = wire[LightUserApi]
lazy val lilaRedis = wire[Lila]
lazy val inquirers = wire[Inquirers]
lazy val roundCrowd = wire[RoundCrowd]
lazy val roomCrowd = wire[RoomCrowd]
lazy val crowdJson = wire[ipc.CrowdJson]
lazy val users = wire[Users]
lazy val keepAlive = wire[KeepAlive]
lazy val lobby = wire[Lobby]
lazy val socialGraph = wire[SocialGraph]
lazy val friendList = wire[FriendList]
lazy val stormSign = wire[StormSign]
lazy val lag = wire[Lag]
lazy val evalCache = wire[lila.ws.evalCache.EvalCacheApi]
lazy val services = wire[Services]
lazy val controller = wire[Controller]
lazy val router = wire[Router]
lazy val seenAt = wire[SeenAtUpdate]
lazy val auth = wire[Auth]
lazy val nettyServer = wire[netty.NettyServer]
lazy val monitor = wire[Monitor]

wire[LilaHandler] // must eagerly instanciate!
wire[RelayCrowd] // must eagerly instanciate!
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/netty/NettyServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import io.netty.handler.codec.http.*
final class NettyServer(
clients: ClientSystem,
router: Router,
config: Config
config: Config,
runPeriodically: util.RunPeriodically
)(using Executor):

private val connector = ActorChannelConnector(clients)
private val connector = ActorChannelConnector(clients, runPeriodically)
private val logger = Logger(getClass)

def start(): Unit =
Expand Down

0 comments on commit 93e297c

Please sign in to comment.