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[T]):

    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
  • package internal
    Definition Classes
    execution
  • package misc
    Definition Classes
    execution
  • package rstreams
    Definition Classes
    execution
  • package schedulers
    Definition Classes
    execution
  • Ack
  • Cancelable
  • CancelableFuture
  • ExecutionModel
  • FutureUtils
  • Listener
  • Macros
  • Scheduler
  • UncaughtExceptionReporter

trait Cancelable extends Serializable

Represents a one-time idempotent action that can be used to cancel async computations, or to release resources that active data sources are holding.

It is equivalent to java.io.Closeable, but without the I/O focus, or to IDisposable in Microsoft .NET, or to akka.actor.Cancellable.

Source
Cancelable.scala
Linear Supertypes
Serializable, Serializable, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cancelable
  2. Serializable
  3. Serializable
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def cancel(): Unit

    Cancels the unit of work represented by this reference.

    Cancels the unit of work represented by this reference.

    Guaranteed idempotency - calling it multiple times should have the same side-effect as calling it only once. Implementations of this method should also be thread-safe.

  2. abstract def getClass(): Class[_]
    Definition Classes
    Any

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  6. def hashCode(): Int
    Definition Classes
    Any
  7. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  8. def toString(): String
    Definition Classes
    Any

Inherited from Serializable

Inherited from Serializable

Inherited from Any

Ungrouped