I need to execute a binary library (ffmpeg) from out of Foxx app. I see there is a built-in child_process
module, but it doesn't have an exec
method like Node.js has. Is there any other way to do so?
Thanks in advance
since foxx is synchroneous I can only advise not to do this from foxx directly. The transcoding process will take time, which you don't want to block database resources for.
You should do this asynchroneous i.e. in a node process.
If you want to have a look how spawning processes works, this can be found in our unit testing suite:
require('internal') => {
executeExternal => launch a process to background
executeExternalAndWait => launch a process and wait for it to finish
killExternal => kill a launched process (only spawned processes can be send signals)
statusExternal => check for the status of an external process, either touch, or wait.
}
All spawned processes are kept on a list inside the server, only self-spawned process can be manipulated.
In modern ArangoDB this needs to be permitted by --javascript.allow-admin-execute else execution will be denied.