[swift-server-dev] Prototype of the discussed HTTP API Spec
me at helgehess.eu
Wed May 31 08:50:16 CDT 2017
On 31 May 2017, at 15:20, Johannes Weiss via swift-server-dev <swift-server-dev at swift.org> wrote:
> Running everything on one thread with an async-only API is pretty much exactly what Node.js has as its only implementation and you might find that the APIs look remarkably similar .
Sorry if this is a little off-topic, but I just wanted to mention that I think neither is really true.
Also the API of Node.js is nothing like the proposal, unless you are saying that ‘callbacks’ are the main criteria for Equatable here. Node.js is not built on simple callbacks like the proposal, but adds the concept of streams (two variants, pull and push). Node push streams are a little like GCD channels. But streams add quite a few more features, including piping, transformations, buffers and automatic back pressure handling.
That is why I said since the beginning that I’m more interested in how the API for the body stream will look like (as this affects sockets as well as HTTP). Now we essentially get separate APIs for the same thing ...
While I’d love to have a nice streaming framework like the one Node has built right into Swift, maybe just some extension of GCD channels would do (if you don’t want to go the full stream-everything approach Noze.io does), but I understand that this is a little out of scope and probably impossible to agree on ;-) Doesn’t matter too much as you can put adapters on top of the stuff.
Hence: off-topic, srz, couldn’t resist.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the swift-server-dev