Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming #42

Open
sshleifer opened this issue Apr 20, 2023 · 1 comment
Open

Streaming #42

sshleifer opened this issue Apr 20, 2023 · 1 comment

Comments

@sshleifer
Copy link

sshleifer commented Apr 20, 2023

I have a streaming endpoint. When I turn on flask-compress it stops streaming. Is there a workaround?

app = Flask(__name__)
app.config["COMPRESS_REGISTER"] = False  # disable default compression of all eligible requests
compress = Compress()
compress.init_app(app)


@app.route("/test")
@compress.compressed()
def myview():
	...
	return map(lambda r: json.dumps(r) + "\n", results)

recv times: [1.02,1.02,1.02]
recv times without decorator: [0.3, 0.6, 1.02]

@alexprengere
Copy link
Collaborator

Relates to #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants