[swift-server-dev] Next HTTP API meeting

Johannes Weiß johannesweiss at apple.com
Tue Apr 4 08:37:30 CDT 2017

Hi Helge,

Sorry, delayed response.

> On 31 Mar 2017, at 15:27, Helge Heß <me at helgehess.eu> wrote:
> On 30 Mar 2017, at 16:31, Helge Heß <me at helgehess.eu> wrote:
>> Personally I find the API a little weird (because the response/request ordering is backwards in the source) :-). But we have to get started somewhere.
>> Notes:
> + there is not way to handle back pressure with that API

our implementation handles back-pressure as part of the HTTP library. So you're correct in that a client of that API can't directly control back-pressure. Personally I feel it's better for that to live inside the HTTP library implementation.

> Does it need to expose a suspend/resume?

see above for my thoughts

> + it provides no way to stop the body processor
> E.g. if you determined that you don’t want to handle the
> content after a while. Something like
>  typealias HTTPBodyHandler = ( HTTPBodyChunk, inout Bool ) -> Void

given that the underlying HTTP parser library needs to parse everything anyway, we just ignore everything that we don't care about. So it'll still be handed to the client but the client would just ignore everything by doing nothing.

> + maybe the writer should have a specific 100-continue?

could do.


More information about the swift-server-dev mailing list