i'm new to python flask REST web services. I'm trying to develop a rest web service which will have a shared queue, multiple threads will constantly write to that queue on the server side and finally when a user calls a GET methods, the service should return first item in the shared queue.
I was trying getting start to develop this by first implementing a shared variable, following is the code I used,
from flask import Flask
app = Flask(__name__)
count= 0 #Shared Variable
@app.route("/")
def counter():
count = count+1
return {'count':count}
if __name__ == "__main__":
app.run()
But even above code is not working. Then I though of using cache for the shared variable, but it will not the correct way to implement a shared queue (my ultimate goal). Please give me your advises