Skip to content

Commit

Permalink
site
Browse files Browse the repository at this point in the history
  • Loading branch information
AL333Z committed May 28, 2024
1 parent bd651ff commit 9faadc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ trait QueuePusher[F[_], T] {
/**
* Publishes a bunch of messages to the queue, with an optional delay.
*/
def push(messages: (List[(T, Map[String, String])]), delay: Option[FiniteDuration]): F[Unit]
def push(messages: List[(T, Map[String, String])], delay: Option[FiniteDuration]): F[Unit]

}
8 changes: 4 additions & 4 deletions docs/getting-started/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ The pipe takes a parameter allowing for batching publications.
```scala mdoc:compile-only
import fs2.{Pipe, Stream}

val input: Stream[IO, String] = ???
val input: Stream[IO, (String, Map[String, String])] = ???

// messages are published in batch of 10
val publicationSink: Pipe[IO, String, Nothing] = publisher.sink(batchSize = 10)
val publicationSink: Pipe[IO, (String, Map[String, String]), Nothing] = publisher.sink(batchSize = 10)

// pipe the message producing stream through the publication sink
input.through(publicationSink)
Expand All @@ -48,7 +48,7 @@ A `QueuePusher` is accessed as a [`Resource`][cats-effect-resource] as it usuall

```scala mdoc:compile-only
publisher.pusher.use { queuePusher =>
val produceMessages: IO[List[String]] = ???
val produceMessages: IO[List[(String, Map[String, String])]] = ???

// produce a batch
produceMessages
Expand All @@ -69,7 +69,7 @@ If you need to spawn background fibers using the `queuePusher`, you can for inst
import cats.effect.std.Supervisor

publisher.pusher.use { queuePusher =>
val produceMessages: IO[List[String]] = ???
val produceMessages: IO[List[(String, Map[String, String])]] = ???

// create a supervisor that waits for supervised spawn fibers
// to finish before being released
Expand Down

0 comments on commit 9faadc6

Please sign in to comment.