Dm.ProverThreadSourceif ~preempt is false the run and try_run APIs enqueue the job rather than forcibly interrupting any running job
The thunks passed to the API below must install a Rocq state with Vernacstate.* and then perform their work. In other words they should be real closures, independent from the Rocq context they are fired in.
val eventually_run :
doc_id:Types.document_id ->
name:string ->
(unit -> 'a) ->
'a Types.interruptible_result Sel.Promise.teventually_run ~doc_id thunk puts the thunk in the and promises to execute it eventually
val try_run :
doc_id:Types.document_id ->
name:string ->
timeout:float ->
(unit -> 'a) ->
'a Types.interruptible_resultrun ~doc_id ~timeout thunk runs thunk and waits timeout seconds.
run ~doc_id thunk runs thunk and waits for its completion.
interrupt ~doc_id interrupts the runnign thunk only if it runs for ~doc_id