You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
I've been looking through example code for the HTTP library and the use of a associated value closure for the HTTPBodyProcessing.processBody case feels kind of usual. I've never seen such a pattern used in the Standard Library. And if this library's future is to be integrated into the Standard Library or shipped with Swift, I think it would be worth looking into keeping as close as possible to the API style of the Standard Library.
Any ideas?
The text was updated successfully, but these errors were encountered:
publicprotocolHTTPRequestHandling:class{func handle(request:HTTPRequest, response:HTTPResponseWriter, processBody:HTTPBodyHandler)}classEchoHandler:HTTPRequestHandling{func handle(request:HTTPRequest, response:HTTPResponseWrite, processBody:HTTPBodyHandler){//Assume the router gave us the right request - at least for now
response.writeHeader(status:.ok, headers:["Transfer-Encoding":"chunked","X-foo":"bar"])processBody{(chunk, stop)in// handle body}}}
I've been looking through example code for the HTTP library and the use of a associated value closure for the
HTTPBodyProcessing.processBody
case feels kind of usual. I've never seen such a pattern used in the Standard Library. And if this library's future is to be integrated into the Standard Library or shipped with Swift, I think it would be worth looking into keeping as close as possible to the API style of the Standard Library.Any ideas?
The text was updated successfully, but these errors were encountered: