Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
613 B

4 years ago
  1. package wow.doge.mygame.subsystems.scriptsystem
  2. import wow.doge.mygame.utils.AkkaUtils
  3. import cats.effect.Resource
  4. import wow.doge.mygame.scriptsystem.ScriptCachingActor
  5. import akka.actor.typed.ActorRef
  6. import akka.actor.typed.SpawnProtocol
  7. import akka.util.Timeout
  8. import akka.actor.typed.Scheduler
  9. class ScriptSystemResource(
  10. path: os.Path,
  11. spawnProtocol: ActorRef[SpawnProtocol.Command]
  12. )(implicit timeout: Timeout, scheduler: Scheduler) {
  13. def make =
  14. Resource.liftF(
  15. AkkaUtils.spawnActorL(
  16. spawnProtocol,
  17. "scriptCachingActor",
  18. ScriptCachingActor()
  19. )
  20. )
  21. }