InspectableQueue

trait InspectableQueue[F[_], A] extends Queue[F, A]

Extension of Queue that allows peeking and inspection of the current size.

Extension of Queue that allows peeking and inspection of the current size.

Companion
object
trait Queue[F, A]
trait Dequeue[F, A]
trait DequeueChunk1[F, Id, A]
trait Dequeue1[F, A]
trait Enqueue[F, A]
class Object
trait Matchable
class Any

Value members

Abstract methods

def getSize: F[Int]

Gets the current size of the queue.

Gets the current size of the queue.

def peek1: F[A]

Returns the element which would be dequeued next, but without removing it. Completes when such an element is available.

Returns the element which would be dequeued next, but without removing it. Completes when such an element is available.

def size: Stream[F, Int]

The time-varying size of this Queue. Emits elements describing the current size of the queue. Offsetting enqueues and de-queues may not result in refreshes.

The time-varying size of this Queue. Emits elements describing the current size of the queue. Offsetting enqueues and de-queues may not result in refreshes.

Finally, note that operations like dequeue are optimized to work on chunks when possible, which will result in faster decreases in size that one might expect. More granular updates can be achieved by calling dequeue1 repeatedly, but this is less efficient than dequeueing in batches.

Inherited methods

def dequeue: Stream[F, A]

Dequeues elements from the queue.

Dequeues elements from the queue.

Inherited from
Dequeue
def dequeue1: F[A]

Dequeues one A from this queue. Completes once one is ready.

Dequeues one A from this queue. Completes once one is ready.

Inherited from
Dequeue1
def dequeueBatch: (F, Int) => A

Provides a pipe that converts a stream of batch sizes in to a stream of elements by dequeuing batches of the specified size.

Provides a pipe that converts a stream of batch sizes in to a stream of elements by dequeuing batches of the specified size.

Inherited from
Dequeue
def dequeueChunk(maxSize: Int): Stream[F, A]

Dequeues elements from the queue, ensuring elements are dequeued in chunks not exceeding maxSize.

Dequeues elements from the queue, ensuring elements are dequeued in chunks not exceeding maxSize.

Inherited from
Dequeue
def dequeueChunk1(maxSize: Int): F[Id[Chunk[A]]]

Dequeues one Chunk[A] with no more than maxSize elements. Completes once one is ready.

Dequeues one Chunk[A] with no more than maxSize elements. Completes once one is ready.

Inherited from
DequeueChunk1
def enqueue: (F, A) => Unit

Enqueues each element of the input stream to this queue by calling enqueue1 on each element.

Enqueues each element of the input stream to this queue by calling enqueue1 on each element.

Inherited from
Enqueue
def enqueue1(a: A): F[Unit]

Enqueues one element to this Queue. If the queue is full this waits until queue has space.

Enqueues one element to this Queue. If the queue is full this waits until queue has space.

This completes after a has been successfully enqueued to this Queue

Inherited from
Enqueue
def imap[B](f: A => B)(g: B => A)(F: Functor[F]): Queue[F, B]

Returns an alternate view of this Queue where its elements are of type B, given two functions, A => B and B => A.

Returns an alternate view of this Queue where its elements are of type B, given two functions, A => B and B => A.

Inherited from
Queue
def offer1(a: A): F[Boolean]

Offers one element to this Queue.

Offers one element to this Queue.

Evaluates to false if the queue is full, indicating the a was not queued up. Evaluates to true if the a was queued up successfully.

Value Params
a

A to enqueue

Inherited from
Enqueue
def tryDequeue1: F[Option[A]]

Tries to dequeue a single element. Unlike dequeue1, this method does not semantically block until a chunk is available - instead, None is returned immediately.

Tries to dequeue a single element. Unlike dequeue1, this method does not semantically block until a chunk is available - instead, None is returned immediately.

Inherited from
Dequeue1
def tryDequeueChunk1(maxSize: Int): F[Option[Id[Chunk[A]]]]

Tries to dequeue a single chunk of no more than max size elements. Unlike dequeueChunk1, this method does not semantically block until a chunk is available - instead, None is returned immediately.

Tries to dequeue a single chunk of no more than max size elements. Unlike dequeueChunk1, this method does not semantically block until a chunk is available - instead, None is returned immediately.

Inherited from
DequeueChunk1