0

We are building a flask application wherein for a specific request we want to be able to stream the response to the client. Something like this

@app.route("/time/")
def time():
    def streamer():
        while True:
            yield "<p>{}</p>".format(datetime.now())
            sleep(1)

return Response(streamer())

This does not work when we use an AWS ALB as the load balancer - the client is unable to read from the stream. Is this a limitation on the AWS ALB side? Should I consider using AWS NLB instead?

Raam
  • 10,296
  • 3
  • 26
  • 27
  • HTTP/2 and gRPC Support - It has features like efficient binary serialization and support for numerous languages in addition to the inherent benefits of HTTP/2 like lighter network footprint, compression, and bi-directional streaming making it better than the legacy protocols like REST. https://aws.amazon.com/elasticloadbalancing/application-load-balancer/ – PeeKay Aug 08 '23 at 10:23

0 Answers0