Thoughts on a full structured concurrency solution for websockets

I have been looking into the new NIOTypedWebSocketServerUpgrader for building a structured concurrency based solution to web sockets. And once an upgrade has occurred it works great.

There doesn't seem to have been much thought put into how to do this prior to the upgrade though. Currently there are two functions shouldUpgrade and upgradePipelineHandler that need to be implemented. Both of these return an EventLoopFuture and therefore are assumed to support asynchronous results. For both of these if I want to support an async response using Swift concurrency I have to do this via an unstructured task. Has there been any thought into how we may do this in a more structured manner?

I've been butting up against this when trying to improve WebsocketKit's APIs (and Vapor's). It's one of the last places that is commonly used and doesn't have a nice solution (even just trying to do unstructured stuff is messy).

Would be very keen to see some improvements and can probably provide some time for working on it too