0

I'm taking Michael Genesereth's General Game Playing (GGP) Coursera course. In GGP a player is allowed a fixed amount of time to make a move. I'm writing my players in Scala. (The underlying GGP codebase is Java.) Does Scala provide any support (or are there any Scala libraries) that can be used to help ensure that a computation will respond in a given time.

om-nom-nom
  • 61,565
  • 12
  • 180
  • 225
RussAbbott
  • 2,506
  • 4
  • 20
  • 32

1 Answers1

3

You can use Futures and get the result with Await.result(future, duration) or one of approaches in Scala Futures - built in timeout?.

Community
  • 1
  • 1
Alexey Romanov
  • 160,869
  • 33
  • 291
  • 457