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?