I have a simple script that is responsible of fetching data from an external API, lets call it connector.py. That script takes some params as an input ,do its job and then write it to a file and return the output.
I want to implement a scheduler that would create and manage two instances of that script, each with his own input(different settings) and make them run in configured intervals with the next constraint:
- Input: Pass the parameters of the connector from the settings, to the sub-process via the stdin channel (not as process args)
- Output: Pass the connector output from the sub-process to the service via the stdout channel
- I have to implement the constant loop cycle by myself (not use a Scheduler for example)
What mechanisem should I use in order to acheive that goal processes?
, threads?
, sub-process?
Im mainly struggling to understand how to deal with stdin/stdout issue for the different connector instances.
Any advice would be appericiated.