hmenyus / node-calls-python

Call Python from NodeJS directly in-process without spawning processes
MIT License
252 stars 26 forks source link

workers and interpreter #53

Closed jakobsa closed 1 year ago

jakobsa commented 1 year ago

Hi,

thank you very much for you work!

When using your lib I face some behavior that I do not see documented or covered in your tests. That is why I raise this issue here.

I have a setup where workers are supposed to be restarted while internally using your interpreter. At start the workers import a python module. Just as in your tests.

However I face issues when a workers is terminated and then recreated. A call to await worker.terminate() causes the subsequent worker instance that does interpreter.importSync(<myPyFilePath>) to throw NoneType takes no arguments

jakobsa commented 1 year ago

After refactoring my test cases I am unable to reproduce the issue. If I succeed reproducing it in the future I'll post an update.