Using Erlang to manage multiple instances of an external process

I have a single-threaded process that accepts an input file and produces an output file (accepts input and output files as input). I want to use Erlang to create, manage and close multiple instances of this process.

Basically, whenever a client process needs to create an output file, the client connects to the Erlang server with the input and output paths - the server initiates a new process - transfers paths to it, and then, as soon as the process is completed, stop the process.

I have a general idea of ​​how gen_server etc. works, but I want to know if I can use erlang to create and delete instances of an external process? (e.g. JAR). Which library should I look at?

+3
source share
2 answers

The os: cmd function is probably the closest, see [ http://www.erlang.org/doc/man/os.html 1 . It assumes that your processes start and then end - the “delete” part is not covered.

+1
source

Source: https://habr.com/ru/post/1710989/


All Articles