Dequeue

cats.effect.std.Dequeue
See theDequeue companion object
trait Dequeue[F[_], A] extends Queue[F, A] with DequeueSource[F, A] with DequeueSink[F, A]

Attributes

Companion:
object
Source:
Dequeue.scala
Graph
Supertypes
trait DequeueSink[F, A]
trait DequeueSource[F, A]
class Queue[F, A]
trait QueueSink[F, A]
trait QueueSource[F, A]
class Object
trait Matchable
class Any
Self type
Dequeue[F, A]

Members list

Concise view

Value members

Abstract methods

def reverse: F[Unit]

Reverse the dequeue in constant time

Reverse the dequeue in constant time

Attributes

Source:
Dequeue.scala

Concrete methods

override def mapK[G[_]](f: FunctionK[F, G]): Dequeue[G, A]

Modifies the context in which this dequeue is executed using the natural transformation f.

Modifies the context in which this dequeue is executed using the natural transformation f.

Attributes

Returns:

a queue in the new context obtained by mapping the current one using f

Definition Classes
Source:
Dequeue.scala

Inherited methods

override def offer(a: A): F[Unit]

Alias for offerBack in order to implement Queue

Alias for offerBack in order to implement Queue

Attributes

Definition Classes
Inherited from:
DequeueSink
Source:
Dequeue.scala
def offerBack(a: A): F[Unit]

Enqueues the given element at the back of the dequeue, possibly fiber blocking until sufficient capacity becomes available.

Enqueues the given element at the back of the dequeue, possibly fiber blocking until sufficient capacity becomes available.

Attributes

a

the element to be put at the back of the dequeue

Inherited from:
DequeueSink
Source:
Dequeue.scala
def offerFront(a: A): F[Unit]

Enqueues the given element at the front of the dequeue, possibly semantically blocking until sufficient capacity becomes available.

Enqueues the given element at the front of the dequeue, possibly semantically blocking until sufficient capacity becomes available.

Attributes

a

the element to be put at the back of the dequeue

Inherited from:
DequeueSink
Source:
Dequeue.scala
def size: F[Int]

Attributes

Inherited from:
QueueSource
Source:
Queue.scala
override def take: F[A]

Alias for takeFront in order to implement Queue

Alias for takeFront in order to implement Queue

Attributes

Definition Classes
Inherited from:
DequeueSource
Source:
Dequeue.scala
def takeBack: F[A]

Dequeues an element from the back of the dequeue, possibly fiber blocking until an element becomes available.

Dequeues an element from the back of the dequeue, possibly fiber blocking until an element becomes available.

Attributes

Inherited from:
DequeueSource
Source:
Dequeue.scala
def takeFront: F[A]

Dequeues an element from the front of the dequeue, possibly semantically blocking until an element becomes available.

Dequeues an element from the front of the dequeue, possibly semantically blocking until an element becomes available.

Attributes

Inherited from:
DequeueSource
Source:
Dequeue.scala
override def tryOffer(a: A): F[Boolean]

Alias for tryOfferBack in order to implement Queue

Alias for tryOfferBack in order to implement Queue

Attributes

Definition Classes
Inherited from:
DequeueSink
Source:
Dequeue.scala
def tryOfferBack(a: A): F[Boolean]

Attempts to enqueue the given element at the back of the dequeue without semantically blocking.

Attempts to enqueue the given element at the back of the dequeue without semantically blocking.

Attributes

a

the element to be put at the back of the dequeue

Returns:

an effect that describes whether the enqueuing of the given element succeeded without blocking

Inherited from:
DequeueSink
Source:
Dequeue.scala
def tryOfferBackN(list: List[A])(implicit F: Monad[F]): F[List[A]]

Attempts to enqueue the given elements at the back of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attempts to enqueue the given elements at the back of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attributes

list

the elements to be put at the back of the queue

Returns:

an effect that contains the remaining valus that could not be offered.

Inherited from:
DequeueSink
Source:
Dequeue.scala
def tryOfferFront(a: A): F[Boolean]

Attempts to enqueue the given element at the front of the dequeue without semantically blocking.

Attempts to enqueue the given element at the front of the dequeue without semantically blocking.

Attributes

a

the element to be put at the back of the dequeue

Returns:

an effect that describes whether the enqueuing of the given element succeeded without blocking

Inherited from:
DequeueSink
Source:
Dequeue.scala
def tryOfferFrontN(list: List[A])(implicit F: Monad[F]): F[List[A]]

Attempts to enqueue the given elements at the front of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attempts to enqueue the given elements at the front of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attributes

list

the elements to be put at the front of the queue

Returns:

an effect that contains the remaining valus that could not be offered.

Inherited from:
DequeueSink
Source:
Dequeue.scala
def tryOfferN(list: List[A])(implicit F: Monad[F]): F[List[A]]

Attempts to enqueue the given elements at the back of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attempts to enqueue the given elements at the back of the queue without semantically blocking. If an item in the list cannot be enqueued, the remaining elements will be returned. This is a convenience method that recursively runs tryOffer and does not offer any additional performance benefits.

Attributes

list

the elements to be put at the back of the queue

Returns:

an effect that contains the remaining valus that could not be offered.

Inherited from:
QueueSink
Source:
Queue.scala
override def tryTake: F[Option[A]]

Alias for tryTakeFront in order to implement Queue

Alias for tryTakeFront in order to implement Queue

Attributes

Definition Classes
Inherited from:
DequeueSource
Source:
Dequeue.scala
def tryTakeBack: F[Option[A]]

Attempts to dequeue an element from the back of the dequeue, if one is available without fiber blocking.

Attempts to dequeue an element from the back of the dequeue, if one is available without fiber blocking.

Attributes

Returns:

an effect that describes whether the dequeueing of an element from the dequeue succeeded without blocking, with None denoting that no element was available

Inherited from:
DequeueSource
Source:
Dequeue.scala
def tryTakeBackN(maxN: Option[Int])(implicit F: Monad[F]): F[List[A]]

Attempts to dequeue elements from the back of the dequeue, if they available without semantically blocking. This is a convenience method that recursively runs tryTakeBack. It does not provide any additional performance benefits.

Attempts to dequeue elements from the back of the dequeue, if they available without semantically blocking. This is a convenience method that recursively runs tryTakeBack. It does not provide any additional performance benefits.

Attributes

maxN

The max elements to dequeue. Passing None will try to dequeue the whole queue.

Returns:

an effect that contains the dequeued elements

Inherited from:
DequeueSource
Source:
Dequeue.scala
def tryTakeFront: F[Option[A]]

Attempts to dequeue an element from the front of the dequeue, if one is available without fiber blocking.

Attempts to dequeue an element from the front of the dequeue, if one is available without fiber blocking.

Attributes

Returns:

an effect that describes whether the dequeueing of an element from the dequeue succeeded without blocking, with None denoting that no element was available

Inherited from:
DequeueSource
Source:
Dequeue.scala
def tryTakeFrontN(maxN: Option[Int])(implicit F: Monad[F]): F[List[A]]

Attempts to dequeue elements from the front of the dequeue, if they available without semantically blocking. This is a convenience method that recursively runs tryTakeFront. It does not provide any additional performance benefits.

Attempts to dequeue elements from the front of the dequeue, if they available without semantically blocking. This is a convenience method that recursively runs tryTakeFront. It does not provide any additional performance benefits.

Attributes

maxN

The max elements to dequeue. Passing None will try to dequeue the whole queue.

Returns:

an effect that contains the dequeued elements

Inherited from:
DequeueSource
Source:
Dequeue.scala
def tryTakeN(maxN: Option[Int])(implicit F: Monad[F]): F[List[A]]

Attempts to dequeue elements from the front of the queue, if they are available without semantically blocking. This method does not guarantee any additional performance benefits beyond simply recursively calling tryTake, though some implementations will provide a more efficient implementation.

Attempts to dequeue elements from the front of the queue, if they are available without semantically blocking. This method does not guarantee any additional performance benefits beyond simply recursively calling tryTake, though some implementations will provide a more efficient implementation.

Attributes

maxN

The max elements to dequeue. Passing None will try to dequeue the whole queue.

Returns:

an effect that contains the dequeued elements

Inherited from:
QueueSource
Source:
Queue.scala