From 39a134918c428625654dc87fa27d4d22ff5ba831 Mon Sep 17 00:00:00 2001 From: "zio-assistant[bot]" <130037499+zio-assistant[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 01:15:05 +0000 Subject: [PATCH] Update README.md (#772) Co-authored-by: ZIO Assistant --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0af715f8..03947b81 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ libraryDependencies += "dev.zio" %% "zio-sqs" % "0.6.5" ## 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 import zio._ @@ -47,7 +47,10 @@ object ProducerConsumerExample extends ZIOAppDefault { _ <- ZIO.scoped(producer.flatMap(_.sendStream(stream).runDrain)) _ <- SqsStream( queueUrl, - SqsStreamSettings(stopWhenQueueEmpty = true, waitTimeSeconds = Some(3)) + SqsStreamSettings.default + .withAutoDelete(true) + .withStopWhenQueueEmpty(true) + .withWaitTimeSeconds(3) ).foreach(msg => Console.printLine(msg.body)) } yield () @@ -60,6 +63,8 @@ object ProducerConsumerExample extends ZIOAppDefault { } ``` +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. + ## Documentation Learn more on the [ZIO SQS homepage](https://zio.dev/zio-sqs)!