Packages

o

com.codedx.util

BlockingQueueIterant

object BlockingQueueIterant extends Loggable

Linear Supertypes
Loggable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BlockingQueueIterant
  2. Loggable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class Capacity(capacity: Int) extends AnyVal with Product with Serializable
  2. trait Producer[T] extends AnyRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def channel[T](capacity: Int = defaultCapacity): (Producer[T], Iterant[Task, T])

    Creates a send/receive channel where the "send" operations block if the receiver is slow, and the "receive" side is modeled as an Iterant.

    Creates a send/receive channel where the "send" operations block if the receiver is slow, and the "receive" side is modeled as an Iterant.

    Used to bridge the gap between blocking-push-style code and async-pull-style code. You probably want to use fromBlockingCallback or fromForeach rather than this method.

    T

    The type of items in the producer

    capacity

    The maximum size of the backing queue before the producer (producer.foreach) blocks.

    returns

    A tuple containing the "send" and "receive" ends of the channel

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  7. val defaultCapacity: Int
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def fromBlockingCallback[T](producer: ((T) ⇒ Unit) ⇒ Unit, blockingExecutor: (Runnable) ⇒ Unit, capacity: Int = defaultCapacity): Iterant[Task, T]

    Creates an Iterant[Task, T] from a producer that is defined solely in terms of a callback function.

    Creates an Iterant[Task, T] from a producer that is defined solely in terms of a callback function. Under the hood, the producer will be run using a callback that pushes values into a blocking queue. On the "pull" end of the queue, an Iterant returned by this method will lazily receive values while there is demand. The producer function will be run by the blockingExecutor (and it will almost certainly block!). You should make sure to avoid using a blockingExecutor that will block the same thread as the consumer, which expects to be run asynchronously.

    It is safe to reuse the consumer; each time you use it, it will re-run the producer on the given executor.

    CAREFUL! Traversable implements Iterable by running its foreach method into a builder, building a strict collection, and returning an iterator over that collection. This might cause an OutOfMemoryError if the collection is large.

    If you have a producer that properly implements Iterable, you should use Iterant's own helper methods rather than this one, since those can avoid blocking.

    T

    The type of items in the producer

    producer

    A "collection" defined in terms of its foreach method.

    blockingExecutor

    A task runner that will be used to run the producer's foreach method when the Iterant returned by this method is run. It should be sure to run the given tasks on a separate thread, preferrably one that expects to run blocking tasks.

    capacity

    The maximum size of the backing queue before the producer (producer.foreach) blocks.

    returns

    An Iterant that will lazily pull items from a blocking queue that is filled by collection.foreach

  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. implicit val logger: Logger
    Attributes
    protected
    Definition Classes
    Loggable
    Annotations
    @transient()
  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Loggable

Inherited from AnyRef

Inherited from Any

Ungrouped