From 343295daaae94029837d84e15cb91f1cd1f533b8 Mon Sep 17 00:00:00 2001 From: andrzej Date: Mon, 17 Jul 2023 11:16:44 +0200 Subject: [PATCH] Fix docs --- .../sttp/client4/internal/httpclient/WebSocketImpl.scala | 4 ++-- docs/backends/summary.md | 4 ++-- docs/backends/synchronous.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/scalajvm/sttp/client4/internal/httpclient/WebSocketImpl.scala b/core/src/main/scalajvm/sttp/client4/internal/httpclient/WebSocketImpl.scala index a93e3c3ec4..15d41ccef1 100644 --- a/core/src/main/scalajvm/sttp/client4/internal/httpclient/WebSocketImpl.scala +++ b/core/src/main/scalajvm/sttp/client4/internal/httpclient/WebSocketImpl.scala @@ -39,8 +39,6 @@ private[client4] abstract class WebSocketImpl[F[_]]( } override def send(f: WebSocketFrame, isContinuation: Boolean = false): F[Unit] = - // ws.send* is not thread-safe - at least one can run at a time. Hence, adding a sequencer to ensure that - // even if called concurrently, these will be run in sequence. monad.suspend { f match { case WebSocketFrame.Text(payload, finalFragment, _) => @@ -89,6 +87,8 @@ private[client4] object WebSocketImpl { ): WebSocketImpl[F] = new WebSocketImpl[F](ws, queue, _isOpen) { override implicit def monad: MonadError[F] = _monad + // ws.send* is not thread-safe - at least one can run at a time. Hence, adding a sequencer to ensure that + // even if called concurrently, these will be run in sequence. override def send(f: WebSocketFrame, isContinuation: Boolean): F[Unit] = sequencer(super.send(f, isContinuation)) override protected[client4] def fromCompletableFuture(cf: CompletableFuture[JWebSocket]): F[Unit] = diff --git a/docs/backends/summary.md b/docs/backends/summary.md index af24513f92..66faa657d6 100644 --- a/docs/backends/summary.md +++ b/docs/backends/summary.md @@ -29,8 +29,8 @@ Below is a summary of all the JVM backends; see the sections on individual backe ==================================== ================================ ================================================= ========================== =================== Class Effect type Supported stream type Supports websockets Fully non-blocking ==================================== ================================ ================================================= ========================== =================== -``DefaultSyncBackend`` None (``Identity``) n/a no no -``HttpClientSyncBackend`` None (``Identity``) n/a no no +``DefaultSyncBackend`` None (``Identity``) n/a yes (regular) no +``HttpClientSyncBackend`` None (``Identity``) n/a yes (regular) no ``DefaultFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no ``HttpClientFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no ``HttpClientMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) yes diff --git a/docs/backends/synchronous.md b/docs/backends/synchronous.md index 79fcd61abe..35f6f3a309 100644 --- a/docs/backends/synchronous.md +++ b/docs/backends/synchronous.md @@ -91,4 +91,4 @@ Synchronous backends don't support non-blocking [streaming](../requests/streamin ## Websockets -Only the OkHttp backend supports regular [websockets](../websockets.md). +Both HttpClient and OkHttp backends support regular [websockets](../websockets.md).