Hello there
I was wondering, do you have an example how to decrease the latency of an http trigger response in a python azure function app? I want the function to return the http response as fast as possible and take its time for the backend process of saving the response to our blob storage account. how do I do that? I think with asyncio but I am not sure how to return the http response without awaiting the backendprocess of saving the response works.
import azure.functions as func
def main(req: func.HttpRequest, outputJson: func.Out[func.InputStream]) -> func.HttpResponse:
business_logic = BusinessLogic()
response = business_logic.get_response()
outputJson.set(response.to_json()) #save the response to a storage blob
return func.HttpResponse(
str(response),
status_code=200
)
Best regards
Kevin Marti