Trait

scalaz.stream.async.mutable

Queue

Related Doc: package mutable

Permalink

trait Queue[A] extends AnyRef

Asynchronous queue interface. Operations are all nonblocking in their implementations, but may be 'semantically' blocking. For instance, a queue may have a bound on its size, in which case enqueuing may block until there is an offsetting dequeue.

Source
Queue.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Queue
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def dequeue: Process[Task, A]

    Permalink

    Provides a process that dequeue from this queue.

    Provides a process that dequeue from this queue. When multiple consumers dequeue from this queue, they dequeue in first-come, first-serve order.

    Please use Topic instead of Queue when all subscribers need to see each value enqueued.

    This process is equivalent to dequeueBatch(1).

  2. abstract def dequeueAvailable: Process[Task, Seq[A]]

    Permalink

    Equivalent to dequeueBatch with an infinite limit.

    Equivalent to dequeueBatch with an infinite limit. Only use this method if your underlying algebra (A) has some sort of constant time "natural batching"! If processing a chunk of size n is linearly more expensive than processing a chunk of size 1, you should always use dequeueBatch with some small limit, otherwise you will disrupt fairness in the nondeterministic merge combinators.

  3. abstract def dequeueBatch(limit: Int): Process[Task, Seq[A]]

    Permalink

    Provides a process that dequeues in chunks.

    Provides a process that dequeues in chunks. Whenever *n* elements are available in the queue, min(n, limit) elements will be dequeud and produced as a single Seq. Note that this naturally does not *guarantee* that limit items are returned in every chunk. If only one element is available, that one element will be returned in its own sequence. This method basically just allows a consumer to "catch up" to a rapidly filling queue in the case where some sort of batching logic is applicable.

  4. abstract def enqueue: Sink[Task, A]

    Permalink

    A Sink for enqueueing values to this Queue.

  5. abstract def enqueueAll(xa: Seq[A]): Task[Unit]

    Permalink

    Enqueue multiple A values in this queue.

    Enqueue multiple A values in this queue. This has same semantics as sequencing repeated calls to enqueueOne.

  6. abstract def enqueueOne(a: A): Task[Unit]

    Permalink

    Enqueue one element in this Queue.

    Enqueue one element in this Queue. Resulting task will terminate with failure if queue is closed or failed. Please note this will get completed _after_ a has been successfully enqueued.

    a

    A to enqueue

  7. abstract def size: immutable.Signal[Int]

    Permalink

    The time-varying size of this Queue.

    The time-varying size of this Queue. This signal refreshes only when size changes. Offsetting enqueues and dequeues may not result in refreshes.

  8. abstract def upperBound: Option[Int]

    Permalink

    The size bound on the queue.

    The size bound on the queue. Returns None if the queue is unbounded.

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to any2stringadd[Queue[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Queue[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to ArrowAssoc[Queue[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    Any
  7. def available: immutable.Signal[Int]

    Permalink

    Returns the available number of entries in the queue.

    Returns the available number of entries in the queue. Always returns Int.MaxValue when the queue is unbounded.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close: Task[Unit]

    Permalink

    Closes this queue.

    Closes this queue. This halts the enqueue Sink and dequeue Process after any already-queued elements are drained.

    After this any enqueue will fail with Terminated(End), and the enqueue Sink will terminate with End.

  10. def ensuring(cond: (Queue[A]) ⇒ Boolean, msg: ⇒ Any): Queue[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to Ensuring[Queue[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (Queue[A]) ⇒ Boolean): Queue[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to Ensuring[Queue[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ Any): Queue[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to Ensuring[Queue[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): Queue[A]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to Ensuring[Queue[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def fail(rsn: Throwable): Task[Unit]

    Permalink

    Like kill, except it terminates with supplied reason.

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to StringFormat[Queue[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  19. def full: immutable.Signal[Boolean]

    Permalink

    Returns true when the queue has reached its upper size bound.

    Returns true when the queue has reached its upper size bound. Always returns false when the queue is unbounded.

  20. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  23. def kill: Task[Unit]

    Permalink

    Kills the queue.

    Kills the queue. Unlike close, this kills all dequeuers immediately. Any subsequent enqueues will fail with Terminated(Kill). The returned Task will completed once all dequeuers and enqueuers have been signalled.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def [B](y: B): (Queue[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Queue[A] to ArrowAssoc[Queue[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Queue[A] to any2stringadd[Queue[A]]

Inherited by implicit conversion StringFormat from Queue[A] to StringFormat[Queue[A]]

Inherited by implicit conversion Ensuring from Queue[A] to Ensuring[Queue[A]]

Inherited by implicit conversion ArrowAssoc from Queue[A] to ArrowAssoc[Queue[A]]

Ungrouped