final case class BatchedExecution(batchSize: Int) extends ExecutionModel with Product with Serializable
ExecutionModel specifying a mixed execution mode under which tasks are executed synchronously in batches up to a maximum size.
After a batch of tasks of the recommended size is executed, the next execution should be asynchronous, forked on a different logical thread.
By specifying the ExecutionModel.recommendedBatchSize, the configuration can be fine-tuned.
- Source
- ExecutionModel.scala
- Alphabetic
- By Inheritance
- BatchedExecution
- ExecutionModel
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- val batchedExecutionModulus: Int
Always equal to
recommendedBatchSize-1
.Always equal to
recommendedBatchSize-1
.Provided for convenience.
- Definition Classes
- BatchedExecution → ExecutionModel
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextFrameIndex(current: Int): Int
Returns the next frame index in the run-loop.
Returns the next frame index in the run-loop.
If the returned integer is zero, then the next cycle in the run-loop should execute asynchronously.
- Definition Classes
- BatchedExecution → ExecutionModel
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val recommendedBatchSize: Int
Recommended batch size used for breaking synchronous loops in asynchronous batches.
Recommended batch size used for breaking synchronous loops in asynchronous batches. When streaming value from a producer to a synchronous consumer it's recommended to break the streaming in batches as to not hold the current thread or run-loop indefinitely.
This is rounded to the next power of 2, because then for applying the modulo operation we can just do:
val modulus = recommendedBatchSize - 1 // ... nr = (nr + 1) & modulus
For the JVM the default value can be adjusted with:
java -Dmonix.environment.batchSize=2048 \ ...
- Definition Classes
- BatchedExecution → ExecutionModel
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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])
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.