Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top