kweb-core icon indicating copy to clipboard operation
kweb-core copied to clipboard

[FR] Extract messaging and routing behaviors to interface, to allow writing adapters for different frameworks

Open GavinRay97 opened this issue 2 years ago • 1 comments

I'd like to add support for using Kweb with Quarkus.

A quick search through the code shows direct Ktor usage in a number of files, but nothing that looks too crazy:

image

If someone were interested in extracting these implementations out into interfaces, how much effort would that be and where would one start?

Thank you (super neat project, by the way!) 🙂

GavinRay97 avatar Apr 29 '22 16:04 GavinRay97

Thank you for the compliment :)

I think abstracting out the HTTP framework should be fairly doable, most of the Ktor-specific stuff is in Kweb.kt, also a little in HttpRequestInfo.kt.

Happy to answer any other questions.

sanity avatar Apr 30 '22 02:04 sanity

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 09 '22 15:10 github-actions[bot]

@sanity @GavinRay97 i got Spring Boot working, see https://github.com/kwebio/kweb-core/pull/340

When i try the same in Quarkus the HTML response partially loads but the browser keeps loading because the response is never flushed/closed from the server. When i remove the asyncSupported parameter from the @WebServlet annotation the HTML response loads but the WebSocket does not work. Because of this: https://github.com/ktorio/ktor/blob/928d405b06b455ec6e49118a24535a806693b09b/ktor-server/ktor-server-servlet/jvm/src/io/ktor/server/servlet/BlockingServlet.kt#L80

BenjaminFaal avatar Oct 18 '22 17:10 BenjaminFaal

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 19 '22 02:11 github-actions[bot]