Hello,
I have been battling through a situation for a while. I have a python program which is a predictor for some operations - returns a 0 or a 1. This is a standalone program independent of nginx.
This program reads a file, parses some values and returns a 0 or a 1 based on the input URL sent as a cli flag to it. The execution times are quite different per execution for this program which is about 170 milliseconds as opposed to running an infinite while loop inside this program and letting it accept the URLs, the latter returning a 0 or a 1 under 2 milliseconds - parsing the file from memory.
I have tried redis, tmux sessions - but both effectively yield the same execution time as per execution - 170 odd milliseconds for redis, while the problem with libtmux is that I am unable to fetch the last line of the output (pane) per execution. It always returns the full screen text which is what I don't want.
I plan to pass nginx incoming to this program as the cli flag and deduce the actions to be taken thereafter based on the 1 or the 0 response. Effectively - I just want a way that I can access an in memory running program and supply inputs to it, fetch outputs from it - via nginx/lua and perform my calculations thereafter.
Any help will be highly appreciated!
Thanks a lot.