From e5f3aa04e7266bd33027d0a95eae5608161e3c97 Mon Sep 17 00:00:00 2001 From: mladens Date: Thu, 26 Sep 2024 10:44:26 +0200 Subject: [PATCH] Fix doc examples --- docs/getting-started/subscribing.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/subscribing.md b/docs/getting-started/subscribing.md index 0001a04..d8a9249 100644 --- a/docs/getting-started/subscribing.md +++ b/docs/getting-started/subscribing.md @@ -139,6 +139,8 @@ Batching method exposes `MessageBatch` giving user control over entire batch as Chunked messages can be accessed via `messages`. ```scala mdoc:compile-only +import cats.effect.Outcome + subscriber .messageBatches(batchSize = 10, waitingTime = 20.seconds) .evalMap { batch => @@ -147,7 +149,7 @@ subscriber IO.println(s"Received $payload") } }.guaranteeCase { - case Outcome.Succeeded(_) => batch.ackAll() + case Outcome.Succeeded(_) => batch.ackAll case _ => batch.nackAll } } @@ -240,6 +242,8 @@ subscriber.puller.use { queuePuller => To pull batches that can be acknowledged in batches, use `pullMessageBatch()` ```scala mdoc:compile-only +import cats.effect.Outcome + subscriber.puller.use { queuePuller => queuePuller @@ -249,8 +253,8 @@ subscriber.puller.use { queuePuller => message.payload.flatMap { payload => IO.println(s"Received $payload") }.guaranteeCase { - case Outcome.Succeeded(_) => batch.ackAll() - case _ => batch.nackAll() + case Outcome.Succeeded(_) => batch.ackAll + case _ => batch.nackAll } } }