When Robot.run() is called, main worker passes full student code to a subworker, which executes the code, then calls the function specified by Robot.run(). May hurt performance slightly, since each subworker needs to load Pyodide whenever a simulation terminates. Currently, spawns 3 subworkers (so up to 3 functions can by run in parallel with Robot.run().
IMPORTANT: Need to add the following response headers to the page for SharedArrayBuffer to work:
When
Robot.run()
is called, main worker passes full student code to a subworker, which executes the code, then calls the function specified byRobot.run()
. May hurt performance slightly, since each subworker needs to load Pyodide whenever a simulation terminates. Currently, spawns 3 subworkers (so up to 3 functions can by run in parallel withRobot.run()
.IMPORTANT: Need to add the following response headers to the page for SharedArrayBuffer to work:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp