typelevel / fs2-netty

What it says on the tin!
Apache License 2.0
48 stars 13 forks source link

Experiment with PipelineWrapper abstraction #1

Open djspiewak opened 3 years ago

djspiewak commented 3 years ago

We want to be able to allow users to wrap up preexisting pipeline handlers in a type safe fashion and add them to a server/client config statically. This might also require generalizing socket from Socket[F] to Socket[F, A] where A is the chunked message type. This would be a relatively restricted interface in the sense that the pipelines would be static per bootstrap (a restriction not imposed by Netty). However, pipelines would still be free to internally mutate their own state on a per connection basis, just as normal. For example, handling the upgrade request from HTTP to WebSockets.

Some basic examples of where this kind of thing is useful:

The existing Netty support for these protocols is extremely good and much faster than what you can do if you push things through the fs2 abstraction; there's almost no reason not to make it possible to apply them within a safe framework.