[swift-server-dev] HTTP API v0.1.0

Helge Heß me at helgehess.eu
Mon Nov 6 12:52:27 CST 2017


On 6. Nov 2017, at 19:20, Johannes Weiß <johannesweiss at apple.com> wrote:
> 
> Hi Helge,
> 
> Why not a
> 
> protocol HTTPRequestHandling {
>    associatedtype Context
> }
> 
> then an implementation that uses DispatchQueues can make `typealias Context = DispatchQueue` or whatever it feels like?

I’m not entirely sure I can follow you here. IMO the `HTTPRequestHandling` protocol doesn’t belong here. It can be useful for OO oriented APIs, but it provided zero value to this framework.

So the primary handler type would be a closure:

  (HTTPRequest, HTTPResponseWriter, SyncContext)

And I can’t make the SyncContext generic in this, right?

hh


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: Message signed with OpenPGP
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20171106/3fd6f72c/attachment.sig>


More information about the swift-server-dev mailing list