pedestal

souenzzo 2025-03-27T19:24:31.114929Z

any interest in a pedestal implementation using jdk-httpserver? There are still things to be done.. If there is interest, I can finish doing this implementation https://github.com/pedestal/pedestal/compare/master...souenzzo:pedestal:jdk-httpserver

đź‘€ 1
souenzzo 2025-03-28T14:17:31.846939Z

@hlship it's not clear to me from where create-connector is invoked I can't find any mention of create-connector in io.pedestal.http namespace https://github.com/pedestal/pedestal/blob/master/http-kit/src/io/pedestal/http/http_kit.clj#L72

hlship 2025-03-28T15:35:13.895679Z

Background: Pedestal has always had this goal of being overly concise (I understand that impulse, just look at Tapestry 5); one aspect of this is being able to say :jetty in the service map, rather than explicitly pipe the service map into the io.pedestal.http.jetty/server function. This looks cool in tiny demos, but has its own issues, such as getting in the way of AOT compilation (since there isn’t a connection between the application code and all the pedestal.jetty code until runtime); this has been patched somewhat, but it is ugly. The new io.pedestal.connector namespace is, effectively, a replacement for io.pedestal.http; Pedestal connectors are based only on the Ring specification, with no Servlet API in sight. Once you use the functions in io.pedestal.connector to configure your connector, you explicitly pass it to a connector function, such as io.pedestal.http.http-kit/create-connector … thus the bridge from application code to Pedestal code is unbroken.

hlship 2025-03-28T15:37:41.286059Z

You can see this in the new tests.

souenzzo 2025-03-28T15:56:51.118049Z

the AoT issue could be solved by using ::http/type http-kit/server (using a function instead of a keyword in type) But OK, I will move to the new connector API

hlship 2025-03-27T20:36:47.407169Z

I think this might be better implemented now as a Pedestal Connector (which doesn't rely on the servlet API). Can you implement WebSockets on top of this API?

hlship 2025-03-27T20:39:08.384929Z

But I like the idea of a non-dependencies implementation to go along with http-kit (one 90k dependency).

souenzzo 2025-03-27T20:43:13.186619Z

Not sure about websockets Maybe it could be possible through this impl https://docs.oracle.com/en/java/javase/24/docs/api/java.net.http/java/net/http/WebSocket.html There is no mentions to "server" or "client" on this page, but websockets are kind of "no distinction between client and server" so IDK Pedestal connector is pretty new 🙂 I'm not sure how to use it (yet)

souenzzo 2025-03-27T21:07:24.743149Z

Can I open a PR, and we exchange comments?

hlship 2025-03-27T22:42:14.981649Z

Absolutely.

hlship 2025-03-27T22:42:37.768959Z

I'm finishing up some fixes to the embedded template and will probably do a snapshot or alpha release today or tomorrow.

👍 1
Joe Lane 2025-03-27T19:44:03.894629Z

huh. TIL. about the jdk-httpserver module.

hlship 2025-03-28T00:07:34.892449Z

Imagine if they loved us enough to give us a standard JSON parser?

Joe Lane 2025-03-28T00:09:30.535539Z

“Last mover advantage” isn’t quite working out with JSON, unfortunately…