snapframework / snap

Top-level package for the official Snap Framework libraries, includes the snaplets API as well as infrastructure for sessions, auth, and templates.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
455 stars 68 forks source link

Socket activation #151

Closed hsenag closed 7 years ago

hsenag commented 9 years ago

I'd like to use socket activation with snap. This basically amounts to exposing an API from snap that accepts a socket directly rather than creating its own.

Would a patch to do this be accepted? If so, any hints on the preferred approach? My initial idea is to add a new case to the ListenPort type.

gregorycollins commented 9 years ago

Hi Ganesh,

This is already on the radar (it's a feature I want as well) and will definitely be possible in snap 1.0, as we are changing how the server is started and I'm going to make sure that you can pass already-bound sockets into the server accept loop. I don't really want to backport a change like this to the snap 0.9 stable branch because we are very close to launching 1.0 and I don't want to waste the effort.

There are two possibilities for integrating this, what do you think?

hsenag commented 9 years ago

Great, thanks! Any idea on timescales for 1.0?

I was planning on using https://hackage.haskell.org/package/socket-activation for handling the C api.

For myself, I'd prefer the "pass a socket in" API so that I can keep the application (darcsden) in control of dealing with the received sockets and potentially parcelling them out to different embedded servers in the same process.

gregorycollins commented 9 years ago

Hi, sorry for the delay -- re: timescales for 1.0, code wise we are pretty close to being able to release it right now but we have a bunch of scrub work to do before we can formally release 1.0. Some of the core devs are having a small get together in SF next weekend and we'll see how close we can get then.

mightybyte commented 7 years ago

Closing for cleanup here. If this is still something you want, open another issue on snap-server.

gregorycollins commented 7 years ago

I didn't get this out the door properly for 1.0 and still really want it myself. :-(