mpenet / hirundo

Helidon 4.x RING adapter - using loom/java21+
Eclipse Public License 2.0
98 stars 7 forks source link

Stateful Websockets #23

Open dspiteself opened 2 months ago

dspiteself commented 2 months ago

I am porting code where I need stateful websockets that are initialized on http upgrade. I made a hack to accomplish that end on my fork

In my fork I just created an atom in the supplier and passed it to all the listener methods when The listener is has the key :stateful set to something truthy. I found Helidon very cumbersome to to work with on this regard and would love your advice on a cleaner way to add this functionality that could be upstreamed.

mpenet commented 2 months ago

Hi,

We already use a "supplied" listener, so I guess I could simply abstract away the listener construction (via say a protocol) and optionally let the user pass a "listenable" which could then hold state if desired. I ll have a look at this later today.