p

zio

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

    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.

  2. trait App extends BootstrapRuntime

    The entry point for a purely-functional application on the JVM.

    The entry point for a purely-functional application on the JVM.

    import zio.App
    import zio.console._
    
    object MyApp extends App {
    
      final def run(args: List[String]) =
        myAppLogic.fold(_ => 1, _ => 0)
    
      def myAppLogic =
        for {
          _ <- putStrLn("Hello! What is your name?")
          n <- getStrLn
          _ <- putStrLn("Hello, " + n + ", good to meet you!")
        } yield ()
    }
  3. trait BootstrapRuntime extends Runtime[ZEnv]
  4. sealed trait CanFail[-E] extends AnyRef

    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.

  5. abstract class CancelableFuture[+A] extends Future[A] with FutureTransformCompat[A]
  6. type Canceler[-R] = ZIO[R, Nothing, Any]
  7. sealed trait Cause[+E] extends Product with Serializable
  8. sealed trait Chunk[+A] extends AnyRef

    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. type ERef[+E, A] = ZRef[E, E, A, A]
  10. sealed trait Exit[+E, +A] extends Product with Serializable

    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].

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

    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)
  12. final case class FiberFailure(cause: Cause[Any]) extends Throwable with Product with Serializable

    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.

  13. final class FiberRef[A] extends Serializable

    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.

  14. final class Has[A] extends Serializable

    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]
  15. type IO[+E, +A] = ZIO[Any, E, A]
  16. sealed abstract class InterruptStatus extends Serializable with Product

    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.

  17. type Layer[+E, +ROut] = ZLayer[Any, E, ROut]
  18. type Managed[+E, +A] = ZManaged[Any, E, A]
  19. trait ManagedApp extends BootstrapRuntime
  20. sealed trait NeedsEnv[+R] extends AnyRef

    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.

  21. final class Promise[E, A] extends Serializable

    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
  22. type Queue[A] = ZQueue[Any, Nothing, Any, Nothing, A, A]
  23. type RIO[-R, +A] = ZIO[R, Throwable, A]
  24. type RLayer[-RIn, +ROut] = ZLayer[RIn, Throwable, ROut]
  25. type RManaged[-R, +A] = ZManaged[R, Throwable, A]
  26. type Ref[A] = ZRef[Nothing, Nothing, A, A]
  27. final class RefM[A] extends Serializable

    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

    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

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

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

    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

    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. type TagType = LightTypeTag
    Definition Classes
    VersionSpecific
  33. type Tagged[A] = Tag[A]
    Definition Classes
    VersionSpecific
  34. type TaggedF[F[_]] = HKTag[AnyRef { type Arg[A] = F[A] }]
    Definition Classes
    VersionSpecific
  35. type TaggedF10[F[_, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[180, 181, 182, 183, 184, 185, 186, 187, 188, 189] = F[180,181,182,183,184,185,186,187,188,189] }]
    Definition Classes
    VersionSpecific
  36. type TaggedF11[F[_, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233] = F[223,224,225,226,227,228,229,230,231,232,233] }]
    Definition Classes
    VersionSpecific
  37. type TaggedF12[F[_, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281] = F[270,271,272,273,274,275,276,277,278,279,280,281] }]
    Definition Classes
    VersionSpecific
  38. type TaggedF13[F[_, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333] = F[321,322,323,324,325,326,327,328,329,330,331,332,333] }]
    Definition Classes
    VersionSpecific
  39. type TaggedF14[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389] = F[376,377,378,379,380,381,382,383,384,385,386,387,388,389] }]
    Definition Classes
    VersionSpecific
  40. type TaggedF15[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449] = F[435,436,437,438,439,440,441,442,443,444,445,446,447,448,449] }]
    Definition Classes
    VersionSpecific
  41. type TaggedF16[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513] = F[498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513] }]
    Definition Classes
    VersionSpecific
  42. type TaggedF17[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581] = F[565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581] }]
    Definition Classes
    VersionSpecific
  43. type TaggedF18[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653] = F[636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653] }]
    Definition Classes
    VersionSpecific
  44. type TaggedF19[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729] = F[711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729] }]
    Definition Classes
    VersionSpecific
  45. type TaggedF2[F[_, _]] = HKTag[AnyRef { type Arg[A, B] = F[A,B] }]
    Definition Classes
    VersionSpecific
  46. type TaggedF20[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809] = F[790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809] }]
    Definition Classes
    VersionSpecific
  47. type TaggedF21[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893] = F[873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893] }]
    Definition Classes
    VersionSpecific
  48. type TaggedF22[F[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981] = F[960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981] }]
    Definition Classes
    VersionSpecific
  49. type TaggedF3[F[_, _, _]] = HKTag[AnyRef { type Arg[A, B, C] = F[A,B,C] }]
    Definition Classes
    VersionSpecific
  50. type TaggedF4[F[_, _, _, _]] = HKTag[AnyRef { type Arg[6, 7, 8, 9] = F[6,7,8,9] }]
    Definition Classes
    VersionSpecific
  51. type TaggedF5[F[_, _, _, _, _]] = HKTag[AnyRef { type Arg[25, 26, 27, 28, 29] = F[25,26,27,28,29] }]
    Definition Classes
    VersionSpecific
  52. type TaggedF6[F[_, _, _, _, _, _]] = HKTag[AnyRef { type Arg[48, 49, 50, 51, 52, 53] = F[48,49,50,51,52,53] }]
    Definition Classes
    VersionSpecific
  53. type TaggedF7[F[_, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[75, 76, 77, 78, 79, 80, 81] = F[75,76,77,78,79,80,81] }]
    Definition Classes
    VersionSpecific
  54. type TaggedF8[F[_, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[106, 107, 108, 109, 110, 111, 112, 113] = F[106,107,108,109,110,111,112,113] }]
    Definition Classes
    VersionSpecific
  55. type TaggedF9[F[_, _, _, _, _, _, _, _, _]] = HKTag[AnyRef { type Arg[141, 142, 143, 144, 145, 146, 147, 148, 149] = F[141,142,143,144,145,146,147,148,149] }]
    Definition Classes
    VersionSpecific
  56. type Task[+A] = ZIO[Any, Throwable, A]
  57. type TaskLayer[+ROut] = ZLayer[Any, Throwable, ROut]
  58. type TaskManaged[+A] = ZManaged[Any, Throwable, A]
  59. sealed abstract class TracingStatus extends Serializable with Product

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

  60. type UIO[+A] = ZIO[Any, Nothing, A]
  61. type ULayer[+ROut] = ZLayer[Any, Nothing, ROut]
  62. type UManaged[+A] = ZManaged[Any, Nothing, A]
  63. type URIO[-R, +A] = ZIO[R, Nothing, A]
  64. type URLayer[-RIn, +ROut] = ZLayer[RIn, Nothing, ROut]
  65. type URManaged[-R, +A] = ZManaged[R, Nothing, A]
  66. type ZEnv = Clock with Console with System with Random with Blocking
    Definition Classes
    PlatformSpecific
  67. sealed trait ZIO[-R, +E, +A] extends Serializable with ZIOPlatformSpecific[R, E, A]

    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.

  68. final class ZLayer[-RIn, +E, +ROut] extends AnyRef

    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 safely 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.

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

    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.

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

    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.

  71. sealed trait ZRef[+EA, +EB, -A, +B] extends Serializable

    A ZRef[EA, EB, A, B] is a polymorphic, purely functional description of a mutable reference.

    A ZRef[EA, EB, A, B] is a polymorphic, purely functional description of a mutable reference. The fundamental operations of a ZRef are set and get. set takes a value of type A and sets the reference to a new value, potentially failing with an error of type EA. get gets the current value of the reference and returns a value of type B, potentially failing with an error of type EB.

    When the error and value types of the ZRef are unified, that is, it is a ZRef[E, E, A, A], the ZRef also supports atomic modify and update operations. All operations are guaranteed to be safe for concurrent access.

    NOTE: While ZRef provides the functional equivalent of a mutable reference, the value inside the ZRef should be immutable. For performance reasons ZRef 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.

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

Value Members

  1. object <*>
  2. object =!= extends Serializable
  3. object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  4. object CanFail extends CanFail[Any]
  5. object Cause extends Serializable
  6. object Chunk
  7. object Exit extends Serializable
  8. object Fiber extends FiberPlatformSpecific
  9. object FiberRef extends Serializable
  10. object Has extends Serializable
  11. object IO
  12. object InterruptStatus extends Serializable
  13. object Managed
  14. object NeedsEnv extends NeedsEnv[Nothing]
  15. object Promise extends Serializable
  16. object Queue
  17. object RIO
  18. object Ref extends Serializable
  19. object RefM extends Serializable
  20. object Runtime
  21. object Schedule extends Serializable
  22. object Semaphore extends Serializable
  23. object Task extends TaskPlatformSpecific
  24. object TracingStatus extends Serializable
  25. object UIO
  26. object URIO
  27. object ZEnv
    Definition Classes
    PlatformSpecific
  28. object ZIO extends ZIOCompanionPlatformSpecific with Serializable
  29. object ZLayer
  30. object ZManaged extends Serializable
  31. object ZQueue extends Serializable
  32. object ZRef extends Serializable
  33. object ZTrace extends Serializable

Inherited from VersionSpecific

Inherited from PlatformSpecific

Inherited from EitherCompat

Inherited from AnyRef

Inherited from Any

Ungrouped