Package

zio

Permalink

package zio

Linear Supertypes
VersionSpecific, PlatformSpecific, EitherCompat, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. zio
  2. VersionSpecific
  3. PlatformSpecific
  4. EitherCompat
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait =!=[A, B] extends Serializable

    Permalink

    Evidence type A is not equal to type B.

    Evidence type A is not equal to type B.

    Based on https://github.com/milessabin/shapeless.

    Annotations
    @implicitNotFound( "${A} must not be ${B}" )
  2. trait App extends BootstrapRuntime

    Permalink
  3. trait BootstrapRuntime extends Runtime[Unit]

    Permalink
  4. sealed trait CanFail[-E] extends AnyRef

    Permalink

    A value of type CanFail[E] provides implicit evidence that an effect with error type E can fail, that is, that E is not equal to Nothing.

    A value of type CanFail[E] provides implicit evidence that an effect with error type E can fail, that is, that E is not equal to Nothing.

    Annotations
    @implicitNotFound( ... )
  5. abstract class CancelableFuture[+A] extends Future[A] with FutureTransformCompat[A]

    Permalink
  6. type Canceler[-R] = ZIO[R, Nothing, Any]

    Permalink
  7. sealed trait Cause[+E] extends Product with Serializable

    Permalink
  8. sealed trait Chunk[+A] extends AnyRef

    Permalink

    A Chunk[A] represents a chunk of values of type A.

    A Chunk[A] represents a chunk of values of type A. Chunks are designed are usually backed by arrays, but expose a purely functional, safe interface to the underlying elements, and they become lazy on operations that would be costly with arrays, such as repeated concatenation.

  9. trait EitherCompat extends AnyRef

    Permalink
  10. implicit class EitherOps[L, R] extends AnyRef

    Permalink
    Definition Classes
    EitherCompat
  11. sealed trait Exit[+E, +A] extends Product with Serializable

    Permalink

    An Exit[E, A] describes the result of executing an IO value.

    An Exit[E, A] describes the result of executing an IO value. The result is either succeeded with a value A, or failed with a Cause[E].

  12. sealed trait Fiber[+E, +A] extends AnyRef

    Permalink

    A fiber is a lightweight thread of execution that never consumes more than a whole thread (but may consume much less, depending on contention and asynchronicity).

    A fiber is a lightweight thread of execution that never consumes more than a whole thread (but may consume much less, depending on contention and asynchronicity). Fibers are spawned by forking ZIO effects, which run concurrently with the parent effect.

    Fibers can be joined, yielding their result to other fibers, or interrupted, which terminates the fiber, safely releasing all resources.

    def parallel[A, B](io1: Task[A], io2: Task[B]): Task[(A, B)] =
      for {
        fiber1 <- io1.fork
        fiber2 <- io2.fork
        a      <- fiber1.join
        b      <- fiber2.join
      } yield (a, b)
  13. final case class FiberFailure(cause: Cause[Any]) extends Throwable with Product with Serializable

    Permalink

    Represents a failure in a fiber.

    Represents a failure in a fiber. This could be caused by some non- recoverable error, such as a defect or system error, by some typed error, or by interruption (or combinations of all of the above).

    This class is used to wrap ZIO failures into something that can be thrown, to better integrate with Scala exception handling.

  14. final class FiberRef[A] extends Serializable

    Permalink

    Fiber's counterpart for Java's ThreadLocal.

    Fiber's counterpart for Java's ThreadLocal. Value is automatically propagated to child on fork and merged back in after joining child.

    for {
      fiberRef <- FiberRef.make("Hello world!")
      child <- fiberRef.set("Hi!).fork
      result <- child.join
    } yield result

    result will be equal to "Hi!" as changes done by child were merged on join.

    FiberRef#make also allows specifying how the values will be combined when joining. By default this will use the value of the joined fiber. for { fiberRef <- FiberRef.make(0, math.max) child <- fiberRef.update(_ + 1).fork _ <- fiberRef.update(_ + 2) _ <- child.join value <- fiberRef.get } yield value }}}

    value will be 2 as the value in the joined fiber is lower and we specified max as our combine function.

  15. final class Has[A] extends Serializable

    Permalink

    The trait Has[A] is used with ZIO environment to express an effect's dependency on a service of type A.

    The trait Has[A] is used with ZIO environment to express an effect's dependency on a service of type A. For example, RIO[Has[Console.Service], Unit] is an effect that requires a Console.Service service. Inside the ZIO library, type aliases are provided as shorthands for common services, e.g.:

    type Console = Has[ConsoleService]
  16. type IO[+E, +A] = ZIO[Any, E, A]

    Permalink
  17. sealed abstract class InterruptStatus extends Serializable with Product

    Permalink

    The InterruptStatus of a fiber determines whether or not it can be interrupted.

    The InterruptStatus of a fiber determines whether or not it can be interrupted. The status can change over time in different regions.

  18. type Managed[+E, +A] = ZManaged[Any, E, A]

    Permalink
  19. trait ManagedApp extends BootstrapRuntime

    Permalink
  20. sealed trait NeedsEnv[+R] extends AnyRef

    Permalink

    A value of type NeedsEnv[R] provides implicit evidence that an effect with environment type R needs an environment, that is, that R is not equal to Any.

    A value of type NeedsEnv[R] provides implicit evidence that an effect with environment type R needs an environment, that is, that R is not equal to Any.

    Annotations
    @implicitNotFound( ... )
  21. trait NotExtends[A, B] extends Serializable

    Permalink
    Annotations
    @implicitNotFound( ... )
  22. final class Promise[E, A] extends Serializable

    Permalink

    A promise represents an asynchronous variable, of zio.IO type, that can be set exactly once, with the ability for an arbitrary number of fibers to suspend (by calling await) and automatically resume when the variable is set.

    A promise represents an asynchronous variable, of zio.IO type, that can be set exactly once, with the ability for an arbitrary number of fibers to suspend (by calling await) and automatically resume when the variable is set.

    Promises can be used for building primitive actions whose completions require the coordinated action of multiple fibers, and for building higher-level concurrent or asynchronous structures.

    for {
      promise <- Promise.make[Nothing, Int]
      _       <- promise.succeed(42).delay(1.second).fork
      value   <- promise.await // Resumes when forked fiber completes promise
    } yield value
  23. type Queue[A] = ZQueue[Any, Nothing, Any, Nothing, A, A]

    Permalink
  24. type RIO[-R, +A] = ZIO[R, Throwable, A]

    Permalink
  25. type RManaged[-R, +A] = ZManaged[R, Throwable, A]

    Permalink
  26. final class Ref[A] extends AnyVal with Serializable

    Permalink

    A mutable atomic reference for the IO monad.

    A mutable atomic reference for the IO monad. This is the IO equivalent of a volatile var, augmented with atomic operations, which make it useful as a reasonably efficient (if low-level) concurrency primitive.

    for {
      ref <- Ref.make(2)
      v   <- ref.update(_ + 3)
      _   <- console.putStrLn("Value = " + v) // Value = 5
    } yield ()

    NOTE: While Ref provides the functional equivalent of a mutable reference, the value inside the Ref should be immutable. For performance reasons Ref is implemented in terms of compare and swap operations rather than synchronization. These operations are not safe for mutable values that do not support concurrent access.

  27. final class RefM[A] extends Serializable

    Permalink

    A mutable atomic reference for the IO monad.

    A mutable atomic reference for the IO monad. This is the IO equivalent of a volatile var, augmented with atomic effectful operations, which make it useful as a reasonably efficient (if low-level) concurrency primitive.

    Unlike Ref, RefM allows effects in atomic operations, which makes the structure slower but more powerful than Ref.

    for {
      ref <- RefM(2)
      v   <- ref.update(_ + putStrLn("Hello World!").attempt.unit *> IO.succeed(3))
      _   <- putStrLn("Value = " + v) // Value = 5
    } yield ()
  28. final case class Reservation[-R, +E, +A](acquire: ZIO[R, E, A], release: (Exit[Any, Any]) ⇒ ZIO[R, Nothing, Any]) extends Product with Serializable

    Permalink

    A Reservation[-R, +E, +A] encapsulates resource acquisition and disposal without specifying when or how that resource might be used.

    A Reservation[-R, +E, +A] encapsulates resource acquisition and disposal without specifying when or how that resource might be used.

    See ZManaged#reserve and ZIO#reserve for details of usage.

  29. trait Runtime[+R] extends AnyRef

    Permalink

    A Runtime[R] is capable of executing tasks within an environment R.

  30. trait Schedule[-R, -A, +B] extends Serializable

    Permalink

    Defines a stateful, possibly effectful, recurring schedule of actions.

    Defines a stateful, possibly effectful, recurring schedule of actions.

    A Schedule[R, A, B] consumes A values, and based on the inputs and the internal state, decides whether to continue or halt. Every decision is accompanied by a (possibly zero) delay, and an output value of type B.

    Schedules compose in each of the following ways:

    1. Intersection, using the && operator, which requires that both schedules continue, using the longer of the two durations. 2. Union, using the || operator, which requires that only one schedule continues, using the shorter of the two durations. 3. Sequence, using the <||> operator, which runs the first schedule until it ends, and then switches over to the second schedule.

    Schedule[R, A, B] forms a profunctor on [A, B], an applicative functor on B, and a monoid, allowing rich composition of different schedules.

  31. final class Semaphore extends Serializable

    Permalink

    An asynchronous semaphore, which is a generalization of a mutex.

    An asynchronous semaphore, which is a generalization of a mutex. Semaphores have a certain number of permits, which can be held and released concurrently by different parties. Attempts to acquire more permits than available result in the acquiring fiber being suspended until the specified number of permits become available.

  32. sealed trait SuperviseMode extends Serializable with Product

    Permalink

    Dictates the supervision mode when a child fiber is forked from a parent fiber.

    Dictates the supervision mode when a child fiber is forked from a parent fiber. There are three possible supervision modes: Disown, Interrupt, and InterruptFork, which determine what the parent fiber will do with the child fiber when the parent fiber exits.

  33. type TagType = LightTypeTag

    Permalink
    Definition Classes
    VersionSpecific
  34. final case class Tagged[A](tag: zio.TaggedType[A]) extends Product with Serializable

    Permalink
  35. type TaggedType[A] = Tag[A]

    Permalink
    Definition Classes
    VersionSpecific
  36. type Task[+A] = ZIO[Any, Throwable, A]

    Permalink
  37. type TaskManaged[+A] = ZManaged[Any, Throwable, A]

    Permalink
  38. sealed abstract class TracingStatus extends Serializable with Product

    Permalink

    Whether ZIO Tracing is enabled for the current fiber in the current region.

  39. type UIO[+A] = ZIO[Any, Nothing, A]

    Permalink
  40. type UManaged[+A] = ZManaged[Any, Nothing, A]

    Permalink
  41. type URIO[-R, +A] = ZIO[R, Nothing, A]

    Permalink
  42. type URManaged[-R, +A] = ZManaged[R, Nothing, A]

    Permalink
  43. type ZEnv = Clock with Console with System with Random

    Permalink
    Definition Classes
    PlatformSpecific
  44. sealed trait ZIO[-R, +E, +A] extends Serializable with ZIOPlatformSpecific[R, E, A]

    Permalink

    A ZIO[R, E, A] value is an immutable value that lazily describes a workflow or job.

    A ZIO[R, E, A] value is an immutable value that lazily describes a workflow or job. The workflow requires some environment R, and may fail with an error of type E, or succeed with a value of type A.

    These lazy workflows, referred to as _effects_, can be informally thought of as functions in the form:

    R => Either[E, A]

    ZIO effects model resourceful interaction with the outside world, including synchronous, asynchronous, concurrent, and parallel interaction.

    ZIO effects use a fiber-based concurrency model, with built-in support for scheduling, fine-grained interruption, structured concurrency, and high scalability.

    To run an effect, you need a Runtime, which is capable of executing effects. Runtimes bundle a thread pool together with the environment that effects need.

  45. final class ZLayer[-RIn, +E, +ROut <: Has[_]] extends AnyRef

    Permalink

    A ZLayer[A, E, B] describes a layer of an application: every layer in an application requires some services (the input) and produces some services (the output).

    A ZLayer[A, E, B] describes a layer of an application: every layer in an application requires some services (the input) and produces some services (the output).

    Layers can be thought of as recipes for producing bundles of services, given their dependencies (other services).

    Construction of layers can be effectful and utilize resources that must be acquired and safetly released when the services are done being utilized.

    By default layers are shared, meaning that if the same layer is used twice the layer will only be allocated a single time.

    Because of their excellent composition properties, layers are the idiomatic way in ZIO to create services that depend on other services.

  46. final class ZManaged[-R, +E, +A] extends Serializable

    Permalink

    A ZManaged[R, E, A] is a managed resource of type A, which may be used by invoking the use method of the resource.

    A ZManaged[R, E, A] is a managed resource of type A, which may be used by invoking the use method of the resource. The resource will be automatically acquired before the resource is used, and automatically released after the resource is used.

    Resources do not survive the scope of use, meaning that if you attempt to capture the resource, leak it from use, and then use it after the resource has been consumed, the resource will not be valid anymore and may fail with some checked error, as per the type of the functions provided by the resource.

  47. trait ZQueue[-RA, +EA, -RB, +EB, -A, +B] extends Serializable

    Permalink

    A ZQueue[RA, EA, RB, EB, A, B] is a lightweight, asynchronous queue into which values of type A can be enqueued and of which elements of type B can be dequeued.

    A ZQueue[RA, EA, RB, EB, A, B] is a lightweight, asynchronous queue into which values of type A can be enqueued and of which elements of type B can be dequeued. The queue's enqueueing operations may utilize an environment of type RA and may fail with errors of type EA. The dequeueing operations may utilize an environment of type RB and may fail with errors of type EB.

  48. final case class ZTrace(fiberId: Id, executionTrace: List[ZTraceElement], stackTrace: List[ZTraceElement], parentTrace: Option[ZTrace]) extends Product with Serializable

    Permalink
  49. trait DefaultRuntime extends Runtime[ZEnv]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0)

Value Members

  1. object <*>

    Permalink
  2. object =!= extends Serializable

    Permalink
  3. object BuildInfo extends Product with Serializable

    Permalink

    This object was generated by sbt-buildinfo.

  4. object CanFail extends CanFail[Any]

    Permalink
  5. object Cause extends Serializable

    Permalink
  6. object Chunk

    Permalink
  7. object Exit extends Serializable

    Permalink
  8. object Fiber extends FiberPlatformSpecific

    Permalink
  9. object FiberRef extends Serializable

    Permalink
  10. object Has extends Serializable

    Permalink
  11. object IO

    Permalink
  12. object InterruptStatus extends Serializable

    Permalink
  13. object Managed

    Permalink
  14. object NeedsEnv extends NeedsEnv[Nothing]

    Permalink
  15. object NotExtends extends Serializable

    Permalink
  16. object Promise extends Serializable

    Permalink
  17. object Queue

    Permalink
  18. object RIO

    Permalink
  19. object Ref extends Serializable

    Permalink
  20. object RefM extends Serializable

    Permalink
  21. object Runtime

    Permalink
  22. object Schedule extends Serializable

    Permalink
  23. object Semaphore extends Serializable

    Permalink
  24. object SuperviseMode extends Serializable

    Permalink
  25. object Tagged extends Serializable

    Permalink
  26. object Task extends TaskPlatformSpecific

    Permalink
  27. object TracingStatus extends Serializable

    Permalink
  28. object UIO

    Permalink
  29. object URIO

    Permalink
  30. object ZEnv extends Serializable

    Permalink
    Definition Classes
    PlatformSpecific
  31. object ZIO extends ZIOCompanionPlatformSpecific with Serializable

    Permalink
  32. object ZLayer

    Permalink
  33. object ZManaged extends Serializable

    Permalink
  34. object ZQueue extends Serializable

    Permalink
  35. object ZTrace extends Serializable

    Permalink
  36. package clock

    Permalink
  37. package console

    Permalink
  38. package duration

    Permalink
  39. package internal

    Permalink
  40. package random

    Permalink
  41. package stm

    Permalink
  42. package system

    Permalink

Inherited from VersionSpecific

Inherited from PlatformSpecific

Inherited from EitherCompat

Inherited from AnyRef

Inherited from Any

Ungrouped