From c36c62b5a1e8fe0c1a98e7b0bb3d63de322c8306 Mon Sep 17 00:00:00 2001 From: Calvin Fernandes Date: Wed, 8 Jan 2025 20:12:47 -0500 Subject: [PATCH] Change example slightly --- docs/index.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/index.md b/docs/index.md index 2ef3ec5..bf6361a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,7 +22,7 @@ libraryDependencies += "dev.zio" %% "zio-sqs" % "@VERSION@" ## Example -In this example we produce a stream of events to the `MyQueue` and then consume them from that queue: +In this example we produce a stream of events to the `MyQueue` and then consume them from that queue (at-most-once delivery semantics): ```scala mdoc:compile-only import zio._ @@ -47,7 +47,10 @@ object ProducerConsumerExample extends ZIOAppDefault { _ <- ZIO.scoped(producer.flatMap(_.sendStream(stream).runDrain)) _ <- SqsStream( queueUrl, - SqsStreamSettings.default.withStopWhenQueueEmpty(true).withWaitTimeSeconds(3) + SqsStreamSettings.default + .withAutoDelete(true) + .withStopWhenQueueEmpty(true) + .withWaitTimeSeconds(3) ).foreach(msg => Console.printLine(msg.body)) } yield () @@ -60,4 +63,4 @@ object ProducerConsumerExample extends ZIOAppDefault { } ``` -Check out the [examples](../zio-sqs/src/test/scala/examples) folder for more examples. \ No newline at end of file +Check out the examples folder in `zio-sqs/src/test/scala/examples` for additional examples that cover at-least-once and at-most-once delivery semantics. \ No newline at end of file