Skip to main content

Non-Blocking Option for Python Methods


If you've used Sindri's Python SDK (possibly by following along with our Python quickstart guide) then you may have noticed a pause when using the create_circuit and prove_circuit methods. Under the hood, these functions are submitting your circuit compile or prove job and polling until the status of the job is complete. While this abstraction is convenient for many cases, your application may have other tasks it can work on independently while Sindri's API processes these requests. For this reason, we added the wait argument to both create_circuit and create_proof.

If you'd like to utilize this "non-blocking" functionality, you can call the methods like so:

python snippet
import os
from sindri import Sindri
sindri = Sindri(os.getenv("SINDRI_API_KEY", ""))
proof_id = sindri.prove_circuit("my-circuit", '{"X": 2, "Y": 2}', wait=False)

The wait argument is assumed to be True if not found. Notice that we did not call create_circuit with wait=False in the code-block above. If we did, the proof would not properly execute because the circuit would not be ready by the time prove_circuit is called.