Queue

cats.effect.std.Queue
See theQueue companion class
object Queue

Attributes

Companion
class
Source
Queue.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Queue.type

Members list

Value members

Concrete methods

def bounded[F[_], A](capacity: Int)(implicit F: GenConcurrent[F, _]): F[Queue[F, A]]

Constructs an empty, bounded queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent.

Constructs an empty, bounded queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent. When the queue is full (contains exactly capacity elements), every next Queue#offer will be backpressured (i.e. the Queue#offer blocks semantically).

Value parameters

capacity

the maximum capacity of the queue

Attributes

Returns

an empty, bounded queue

Source
Queue.scala
def circularBuffer[F[_], A](capacity: Int)(implicit F: GenConcurrent[F, _]): F[Queue[F, A]]

Constructs an empty, bounded, circular buffer queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent.

Constructs an empty, bounded, circular buffer queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent. The queue always keeps at most capacity number of elements, with the oldest element in the queue always being dropped in favor of a new elements arriving in the queue, and the offer effect itself will not semantically block.

Value parameters

capacity

the maximum capacity of the queue

Attributes

Returns

an empty, bounded, sliding queue

Source
Queue.scala
def dropping[F[_], A](capacity: Int)(implicit F: GenConcurrent[F, _]): F[Queue[F, A]]

Constructs an empty, bounded, dropping queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent.

Constructs an empty, bounded, dropping queue holding up to capacity elements for F data types that are cats.effect.kernel.GenConcurrent. When the queue is full (contains exactly capacity elements), every next Queue#offer will be ignored, i.e. no other elements can be enqueued until there is sufficient capacity in the queue, and the offer effect itself will not semantically block.

Value parameters

capacity

the maximum capacity of the queue

Attributes

Returns

an empty, bounded, dropping queue

Source
Queue.scala
def synchronous[F[_], A](implicit F: GenConcurrent[F, _]): F[Queue[F, A]]

Constructs a queue through which a single element can pass only in the case when there are at least one taking fiber and at least one offering fiber for F data types that are cats.effect.kernel.GenConcurrent.

Constructs a queue through which a single element can pass only in the case when there are at least one taking fiber and at least one offering fiber for F data types that are cats.effect.kernel.GenConcurrent. Both Queue#offer and Queue#take semantically block until there is a fiber executing the opposite action, at which point both fibers are freed.

Attributes

Returns

a synchronous queue

Source
Queue.scala
def unbounded[F[_], A](implicit F: GenConcurrent[F, _]): F[Queue[F, A]]

Constructs an empty, unbounded queue for F data types that are cats.effect.kernel.GenConcurrent.

Constructs an empty, unbounded queue for F data types that are cats.effect.kernel.GenConcurrent. Queue#offer never blocks semantically, as there is always spare capacity in the queue.

Attributes

Returns

an empty, unbounded queue

Source
Queue.scala

Implicits

Implicits

implicit def catsInvariantForQueue[F[_] : Functor]: Invariant[[_] =>> Queue[F, _$34]]

Attributes

Source
Queue.scala