object BlockingQueueIterant extends Loggable
- Alphabetic
- By Inheritance
- BlockingQueueIterant
- Loggable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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
orfromForeach
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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- val defaultCapacity: Int
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromBlockingCallback[T](producer: ((T) => Unit) => Unit, blockingExecutor: (Runnable) => Unit, capacity: Int = defaultCapacity): Iterant[Task, T]
Creates an
Iterant[Task, T]
from aproducer
that is defined solely in terms of a callback function.Creates an
Iterant[Task, T]
from aproducer
that is defined solely in terms of a callback function. Under the hood, theproducer
will be run using a callback that pushes values into a blocking queue. On the "pull" end of the queue, anIterant
returned by this method will lazily receive values while there is demand. Theproducer
function will be run by theblockingExecutor
(and it will almost certainly block!). You should make sure to avoid using ablockingExecutor
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
implementsIterable
by running itsforeach
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 useIterant
'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 bycollection.foreach
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit val logger: Logger
- Attributes
- protected
- Definition Classes
- Loggable
- Annotations
- @transient()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated