w13rfed
w13rfed

Reputation: 375

Run Python in background of NodeJS

I'm not sure what I'm trying to do is possible, but I'm trying to write a NodeJS application that needs to call some Python functions, the way I'm going to use Python functions is similar to How to call Python function from NodeJS by using child_process

If the python script had a few imports that had a slight delay when running the script, if you were calling the python script often surely it would cause problems for the applications running time. Is there a way to get around to constantly keep a child process python call open and then call a function whenever it's needed?

Thanks

Upvotes: 0

Views: 373

Answers (1)

bruno desthuilliers
bruno desthuilliers

Reputation: 77912

There's nothing specific to Python nor node.js here. If you don't want the overhead of spawning a child process, make the "other" script / application / whatever a long running process and use any kind of inter-process communication.

Upvotes: 1

Related Questions