You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's your opinion about another build method that looks like this:
defbuild(
pipe: Pipe[F, WebSocketFrame, WebSocketFrame]
headers: Headers=Headers.empty,
onNonWebSocketRequest: F[Response[F]] =Response[F](Status.NotImplemented).withEntity("This is a WebSocket route.").pure[F],
onHandshakeFailure: F[Response[F]] =Response[F](Status.BadRequest)
.withEntity("WebSocket handshake failed.").pure[F])
Similarly how it's done in akka-http. I believe it is enough for many use cases of websockets, can simplify the code and it's easier to reason about for these use cases.
The text was updated successfully, but these errors were encountered:
I'm actually thinking that a model based on a Pipe might be cleaner than what we have now, here's a small snippet discussing translating back and forth between the two:
caseclassBuilder(in: Sink[F, Frame], out: Stream[F, Frame])
caseclassPiped(pipe: Pipe[F, Frame, Frame])
defpipedToBuilder(p: Piped):F[Builder] =
needs to create the queue, and also quite possibly wrap everything in Option to use `unNoneTerminate`,
without it you get race conditions like the one in Chris example that requires `sleep`
What's your opinion about another build method that looks like this:
Similarly how it's done in akka-http. I believe it is enough for many use cases of websockets, can simplify the code and it's easier to reason about for these use cases.
The text was updated successfully, but these errors were encountered: