statebox / cql

CQL: Categorical Query Language implementation in Haskell
GNU Affero General Public License v3.0
162 stars 14 forks source link

Timeouts #99

Closed wisnesky closed 5 years ago

wisnesky commented 5 years ago

Implement a feature that allows the program to stop after a certain time has passed since the computation started.

wisnesky commented 5 years ago

Experiments indicate Control.DeepSeq is what is needed

wisnesky commented 5 years ago

This issue is to implement the 'timeout' option from the AQL language spec.

wisnesky commented 5 years ago

I added NFData instances and tried to used deepseq, but timeouts still don't work.

wisnesky commented 5 years ago

deepseq induces non-termination, see Employee example.

wisnesky commented 5 years ago

Someone on the internet claims you can fork two threads, one that does the computation and the other which sleeps for X seconds, and the first one to complete destroys the other. That is how the java version works.

wisnesky commented 5 years ago

The forking version works.