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

Allow generating response programmatically #80

Merged
merged 4 commits into from
Jul 20, 2019

Conversation

kornelski
Copy link
Contributor

Fixes #64

@lipanski
Copy link
Owner

first of all, thanks for this PR 🥇

a few notes:

  1. please check the 1.32 failures in Travis. I'm not against bumping up the minimum supported version but only if there are no (easy) fixes.

  2. what happens if we'd like to change the response status programmatically? or the headers? is there any way this could be adressed here? if not, I'm actually fine with your implementation but the interface might change once we bring the status & headers in.

  3. I assume you've used the chunked transfer-encoding because you don't have access to the body at all so it's hard to compute the content length? or could we still have an option for the content-length based transfer?

@kornelski
Copy link
Contributor Author

  1. fixed
  2. the callback is called too late to change these. It's better to have a separate API for this.
  3. Chunked encoding allows the callback to stream the response without buffering. It makes it possible to output some data, flush/wait, then output more.

@lipanski
Copy link
Owner

@kornelski

  1. you've hit the clippy failures now (which is set to 1.32 as well). clippy can be changed to stable if you want but that brings other joys (=errors to fix).

  2. ok, fair enough.

  3. ok, thanks for the explanation.

@kornelski
Copy link
Contributor Author

Updated

@lipanski lipanski merged commit 2ba5b6c into lipanski:master Jul 20, 2019
@lipanski
Copy link
Owner

Released as 0.19.0 🚀 Thanks!

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

Successfully merging this pull request may close these issues.

Mock with latency?
2 participants