The purpose of this library is to accelerate script execution for question generation in PrairieLearn.
Python Script
# simple.py
def add(a, b):
return a + b
Javascript
var zyPool = new ZygotePool(5, (err)=>{
var zyInt = zyPool.request();
zyInt.call("simple", "add", [1,2], {}, (err, output) => {
// output.result == 3
zyInt.done();
});
});
npm test
Note: If you find that lots of tests are failing to run, it may be usefull
to run tests in band mode. i.e:
npm test -- --runInBand