Integration of multiple third party tools written in different languages to meteor

Hi, I got a requirement to integrate multiple third-party tools that are written in different languages (eg. go, python) to Meteor backend. The idea is the build an automated app that uses a different kind of tools together in one app. Can someone give me a guideline of the way to approach this? Thank you!

PS. to be more specific, these tools run on a terminal by giving a command line to get some results.

1 Like

Easiest is to start them in a child process:
https://nodejs.org/api/child_process.html

For things with a bit of startup time, or that you will want to use frequently, start them as a daemon and send them requests as though they were an external API (using whatever protocol or socket makes sense for your tool)

Example: I made a meteor app that calls a python tool for image segmentation and background removal.
Initially, I used spawn to start the python process and perform the segmentation.
Starting the python process took 2s (loading ML models) and the segmentation took 0.35s.
So I changed the python tool to run a webserver and POSTed the file path to it instead, saving the startup time for each image and speeding up the process by a lot

4 Likes

Fantastic - I’ve got a requirement for a future project where I’ll have to do exactly this (send aggregated data to a 3rd party prediction algorithm written in Python, which will probably be running on the same server). Thanks @coagmano!

@coagmano Thank you! for your response!
I’m new to meteor and I’ve been struggling to get the code works together. Do you have a meteor code example or repo that dealing with child_process and how to send and fetch the result from the terminal tools and save it in the DB and can be manipulated later in the backend. That would be much appreciated. Thank you!

Not a meteor example but will work with meteor as well. This is a electron example calling python program. https://github.com/fyears/electron-python-example