Class/Object

zio

ZQueue

Related Docs: object ZQueue | package zio

Permalink

abstract class ZQueue[-RA, -RB, +EA, +EB, -A, +B] extends Serializable

A ZQueue[RA, RB, EA, EB, A, B] is a lightweight, asynchronous queue into which values of type A can be enqueued and of which elements of type B can be dequeued. The queue's enqueueing operations may utilize an environment of type RA and may fail with errors of type EA. The dequeueing operations may utilize an environment of type RB and may fail with errors of type EB.

Self Type
ZQueue[RA, RB, EA, EB, A, B]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZQueue
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ZQueue()

    Permalink

Abstract Value Members

  1. abstract def awaitShutdown: UIO[Unit]

    Permalink

    Waits until the queue is shutdown.

    Waits until the queue is shutdown. The IO returned by this method will not resume until the queue has been shutdown. If the queue is already shutdown, the IO will resume right away.

  2. abstract def capacity: Int

    Permalink

    How many elements can hold in the queue

  3. abstract def isShutdown: UIO[Boolean]

    Permalink

    true if shutdown has been called.

  4. abstract def offer(a: A): ZIO[RA, EA, Boolean]

    Permalink

    Places one value in the queue.

  5. abstract def offerAll(as: Iterable[A]): ZIO[RA, EA, Boolean]

    Permalink

    For Bounded Queue: uses the BackPressure Strategy, places the values in the queue and always returns true.

    For Bounded Queue: uses the BackPressure Strategy, places the values in the queue and always returns true. If the queue has reached capacity, then the fiber performing the offerAll will be suspended until there is room in the queue.

    For Unbounded Queue: Places all values in the queue and returns true.

    For Sliding Queue: uses Sliding Strategy If there is room in the queue, it places the values otherwise it removes the old elements and enqueues the new ones. Always returns true.

    For Dropping Queue: uses Dropping Strategy, It places the values in the queue but if there is no room it will not enqueue them and return false.

  6. abstract def shutdown: UIO[Unit]

    Permalink

    Interrupts any fibers that are suspended on offer or take.

    Interrupts any fibers that are suspended on offer or take. Future calls to offer* and take* will be interrupted immediately.

  7. abstract def size: UIO[Int]

    Permalink

    Retrieves the size of the queue, which is equal to the number of elements in the queue.

    Retrieves the size of the queue, which is equal to the number of elements in the queue. This may be negative if fibers are suspended waiting for elements to be added to the queue.

  8. abstract def take: ZIO[RB, EB, B]

    Permalink

    Removes the oldest value in the queue.

    Removes the oldest value in the queue. If the queue is empty, this will return a computation that resumes when an item has been added to the queue.

  9. abstract def takeAll: ZIO[RB, EB, Chunk[B]]

    Permalink

    Removes all the values in the queue and returns the values.

    Removes all the values in the queue and returns the values. If the queue is empty returns an empty collection.

  10. abstract def takeUpTo(max: Int): ZIO[RB, EB, Chunk[B]]

    Permalink

    Takes up to max number of values in the queue.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def contramap[C](f: (C) ⇒ A): ZQueue[RA, RB, EA, EB, C, B]

    Permalink

    Transforms elements enqueued into this queue with a pure function.

  7. final def contramapZIO[RA2 <: RA, EA2 >: EA, C](f: (C) ⇒ ZIO[RA2, EA2, A]): ZQueue[RA2, RB, EA2, EB, C, B]

    Permalink

    Transforms elements enqueued into this queue with an effectful function.

  8. final def dimap[C, D](f: (C) ⇒ A, g: (B) ⇒ D): ZQueue[RA, RB, EA, EB, C, D]

    Permalink

    Transforms elements enqueued into and dequeued from this queue with the specified pure functions.

  9. final def dimapZIO[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZIO[RC, EC, A], g: (B) ⇒ ZIO[RD, ED, D]): ZQueue[RC, RD, EC, ED, C, D]

    Permalink

    Transforms elements enqueued into and dequeued from this queue with the specified effectual functions.

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def filterInput[A1 <: A](f: (A1) ⇒ Boolean): ZQueue[RA, RB, EA, EB, A1, B]

    Permalink

    Applies a filter to elements enqueued into this queue.

    Applies a filter to elements enqueued into this queue. Elements that do not pass the filter will be immediately dropped.

  13. final def filterInputZIO[R2 <: RA, E2 >: EA, A1 <: A](f: (A1) ⇒ ZIO[R2, E2, Boolean]): ZQueue[R2, RB, E2, EB, A1, B]

    Permalink

    Like filterInput, but uses an effectful function to filter the elements.

  14. final def filterOutput(f: (B) ⇒ Boolean): ZQueue[RA, RB, EA, EB, A, B]

    Permalink

    Filters elements dequeued from the queue using the specified predicate.

  15. def filterOutputZIO[RB1 <: RB, EB1 >: EB](f: (B) ⇒ ZIO[RB1, EB1, Boolean]): ZQueue[RA, RB1, EA, EB1, A, B]

    Permalink

    Filters elements dequeued from the queue using the specified effectual predicate.

  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def map[C](f: (B) ⇒ C): ZQueue[RA, RB, EA, EB, A, C]

    Permalink

    Transforms elements dequeued from this queue with a function.

  21. final def mapZIO[R2 <: RB, E2 >: EB, C](f: (B) ⇒ ZIO[R2, E2, C]): ZQueue[RA, R2, EA, E2, A, C]

    Permalink

    Transforms elements dequeued from this queue with an effectful function.

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def poll: ZIO[RB, EB, Option[B]]

    Permalink

    Take the head option of values in the queue.

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. final def takeBetween(min: Int, max: Int): ZIO[RB, EB, Chunk[B]]

    Permalink

    Takes a number of elements from the queue between the specified minimum and maximum.

    Takes a number of elements from the queue between the specified minimum and maximum. If there are fewer than the minimum number of elements available, suspends until at least the minimum number of elements have been collected.

  28. final def takeN(n: Int): ZIO[RB, EB, Chunk[B]]

    Permalink

    Takes the specified number of elements from the queue.

    Takes the specified number of elements from the queue. If there are fewer than the specified number of elements available, it suspends until they become available.

  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def contramapM[RA2 <: RA, EA2 >: EA, C](f: (C) ⇒ ZIO[RA2, EA2, A]): ZQueue[RA2, RB, EA2, EB, C, B]

    Permalink

    Transforms elements enqueued into this queue with an effectful function.

    Transforms elements enqueued into this queue with an effectful function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use contramapZIO

  2. final def dimapM[RC <: RA, RD <: RB, EC >: EA, ED >: EB, C, D](f: (C) ⇒ ZIO[RC, EC, A], g: (B) ⇒ ZIO[RD, ED, D]): ZQueue[RC, RD, EC, ED, C, D]

    Permalink

    Transforms elements enqueued into and dequeued from this queue with the specified effectual functions.

    Transforms elements enqueued into and dequeued from this queue with the specified effectual functions.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use dimapZIO

  3. final def filterInputM[R2 <: RA, E2 >: EA, A1 <: A](f: (A1) ⇒ ZIO[R2, E2, Boolean]): ZQueue[R2, RB, E2, EB, A1, B]

    Permalink

    Like filterInput, but uses an effectful function to filter the elements.

    Like filterInput, but uses an effectful function to filter the elements.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use filterInputZIO

  4. def filterOutputM[RB1 <: RB, EB1 >: EB](f: (B) ⇒ ZIO[RB1, EB1, Boolean]): ZQueue[RA, RB1, EA, EB1, A, B]

    Permalink

    Filters elements dequeued from the queue using the specified effectual predicate.

    Filters elements dequeued from the queue using the specified effectual predicate.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use filterOutputZIO

  5. final def mapM[R2 <: RB, E2 >: EB, C](f: (B) ⇒ ZIO[R2, E2, C]): ZQueue[RA, R2, EA, E2, A, C]

    Permalink

    Transforms elements dequeued from this queue with an effectful function.

    Transforms elements dequeued from this queue with an effectful function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIO

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped