Packages

  • package root

    This is the API documentation for the Monix library.

    Package Overview

    monix.execution exposes lower level primitives for dealing with asynchronous execution:

    monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.

    monix.reactive exposes the Observable pattern:

    monix.types implements type-class shims, to be translated to type-classes provided by libraries such as Cats or Scalaz.

    monix.cats is the optional integration with the Cats library, providing translations for the types described in monix.types.

    monix.scalaz is the optional integration with the Scalaz library, providing translations for the types described in monix.types.

    Definition Classes
    root
  • package monix
    Definition Classes
    root
  • package execution
    Definition Classes
    monix
  • package atomic

    A small toolkit of classes that support compare-and-swap semantics for safe mutation of variables.

    A small toolkit of classes that support compare-and-swap semantics for safe mutation of variables.

    On top of the JVM, this means dealing with lock-free thread-safe programming. Also works on top of Javascript, with Scala.js, for API compatibility purposes and because it's a useful way to box a value.

    The backbone of Atomic references is this method:

    def compareAndSet(expect: T, update: T): Boolean

    This method atomically sets a variable to the update value if it currently holds the expect value, reporting true on success or false on failure. The classes in this package also contain methods to get and unconditionally set values.

    Building a reference is easy with the provided constructor, which will automatically return the most specific type needed (in the following sample, that's an AtomicDouble, inheriting from AtomicNumber[A]):

    val atomicNumber = Atomic(12.2)
    
    atomicNumber.incrementAndGet()
    // => 13.2

    These also provide useful helpers for atomically mutating of values (i.e. transform, transformAndGet, getAndTransform, etc...) or of numbers of any kind (incrementAndGet, getAndAdd, etc...).

    Definition Classes
    execution
  • package cancelables

    Cancelables represent asynchronous units of work or other things scheduled for execution and whose execution can be canceled.

    Cancelables represent asynchronous units of work or other things scheduled for execution and whose execution can be canceled.

    One use-case is the scheduling done by monix.execution.Scheduler, in which the scheduling methods return a Cancelable, allowing the canceling of the scheduling.

    Example:

    val s = ConcurrentScheduler()
    val task = s.scheduleRepeated(10.seconds, 50.seconds, {
      doSomething()
    })
    
    // later, cancels the scheduling ...
    task.cancel()
    Definition Classes
    execution
  • package exceptions
    Definition Classes
    execution
  • APIContractViolationException
  • BufferOverflowException
  • CompositeException
  • DownstreamTimeoutException
  • DummyException
  • ExecutionRejectedException
  • UpstreamTimeoutException
  • package internal
    Definition Classes
    execution
  • package misc
    Definition Classes
    execution
  • package rstreams
    Definition Classes
    execution
  • package schedulers
    Definition Classes
    execution
p

monix.execution

exceptions

package exceptions

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class APIContractViolationException extends RuntimeException with Serializable

    Generic exception thrown on API contract violations.

  2. class BufferOverflowException extends RuntimeException with Serializable

    An exception emitted on buffer overflows, like when using OverflowStrategy.Fail.

  3. class CompositeException extends RuntimeException with Serializable

    A composite exception represents a list of exceptions that were caught while delaying errors.

  4. class DownstreamTimeoutException extends TimeoutException with Serializable

    Exception thrown whenever a downstream listener on a back-pressured data-source is taking too long to process a received event.

  5. final case class DummyException(message: String) extends RuntimeException with Serializable with Product

    Used in testing to trigger dummy exceptions.

    Used in testing to trigger dummy exceptions.

    Not to be used for anything except in testing, since this exception type implements structural equality.

    This means that these 2 exceptions are considered equal, even if they have different stack-traces:

    val dummy1 = DummyException("dummy")
    val dummy2 = DummyException("dummy")
    
    dummy == dummy2
    //=> true
  6. class ExecutionRejectedException extends RuntimeException with Serializable

    Exception thrown whenever an execution attempt was rejected.

    Exception thrown whenever an execution attempt was rejected.

    Such execution attempts can come for example from Task or from methods returning Future references, with this exception being thrown in case the execution was rejected due to in place protections, such as a circuit breaker.

  7. class UpstreamTimeoutException extends TimeoutException with Serializable

    Exception thrown whenever a upstream listener on a back-pressured data-source is taking too long to process a received event.

Ungrouped