Issue
I have a code that contains a variable that I want to change manually when I want without stopping the main loop neither pause it (with input()). I can't find a library that allows me to set manually in the run, or access the RAM memory to change that value. for now I set a file watcher that reads the parameters every 1 minutes but this is inefficient way I presume.
Solution
I guess you just want to expose API. You did it with files which works but less common. You can use common best practices such as:
- HTTP web-server. You can do it quickly with Flask/bottle.
- gRPC
- pub/sub mechanism - Redis, Kafka (more complicated, requires another storage solution - the DB itself).
I guess that there are tons of other solution but you got the idea. I hope that's what you're looking for.
With those solution you can manually trigger your endpoint and change whatever you want in your application.
Answered By - ItayB
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.