tags:

views:

215

answers:

2

I have a single threaded process, which takes an input file and produces an output file (takes file in and file out paths as inputs). I want to use Erlang to create, manage and close multiple instances of this process.

Basically, whenever the client process need to produce the output file, the client connects to the Erlang server with the input and output path - the server initiates a new process - feeds it the paths, and then once the process is done, terminate the process.

I have basic understanding of how gen_server etc. work, but I want to know whether I can use erlang to create and delete instances of an external process? (e.g. a JAR). What library should I look into?

+1  A: 

The os:cmd function is probably the closest, see [http://www.erlang.org/doc/man/os.html[1]. It does assume that your processes run and then finish - the "deleting" part is not covered.

Alan Moore
+1  A: 

Look at ports. http://www.erlang.org/doc/man/erlang.html#open_port-2

Hynek -Pichi- Vychodil