ceylon-sdk icon indicating copy to clipboard operation
ceylon-sdk copied to clipboard

ceylon.net Server API attach behaviour

Open akberc opened this issue 11 years ago • 2 comments

Hi @matejonnet This is more of a feature request.than an issue.

ceylon.net server works great and is very handy and flexible. Is there a way to extend the Server API with attach behaviour (in addition to start and stop) so that they it can latch on to an existing Java web server connector that is already bound to a host:port and throw an error if an existing service does not exist. Or maybe a parameter to start where the default is 'attach' behaviour and the parameter forces a new service so that the same code can be used in dev and production.

By default, it would try to find an existing undertow/xnio service and fail if it is not running. In the future, it could theoretically attach to a Tomcat connector host:port - obviously with separate Java implementation.

This would be handy for running in managed containers while re-using the excellent request, response, matcher and endpoint APIs.

What do you think?

akberc avatar Feb 15 '14 14:02 akberc

Hi, I find it usefull to have an option to run a Ceylon Http Sever in a managed container. But I'm not sure if attach is the right way to go. If you want to run it an container, you have to write your own "bridge", right? Which also has its own start implementation, where you can hook on containers "connector".

First step should be refactoring of ceylon.net.http.server.internal package to extract undertow/xnio bridging code.

matejonnet avatar Feb 17 '14 15:02 matejonnet

@matejonnet is this an issue that needs attention? Should it be implemented? Should it be reworded as a different issue? Etc etc. Assigning to 1.2 for now.

quintesse avatar Oct 03 '14 18:10 quintesse