Skip to content

Instantly share code, notes, and snippets.

@Daenyth
Daenyth / KeyedEnqueue.scala
Created October 9, 2019 14:22
fs2 groupBy / KeyedEnqueue
import cats.Monad
import cats.effect.concurrent.{Ref, Semaphore}
import cats.effect.{Concurrent, Resource}
import cats.implicits._
import fs2.{Pipe, Stream}
import fs2.concurrent.{NoneTerminatedQueue, Queue}
/** Represents the ability to enqueue keyed items into a stream of queues that emits homogenous keyed streams.
*