Packages

t

zio

App

trait App extends ZApp[ZEnv] with BootstrapRuntime

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

  val myAppLogic =
    for {
      _ <- printLine("Hello! What is your name?")
      n <- readLine
      _ <- printLine("Hello, " + n + ", good to meet you!")
    } yield ()
}
Annotations
@deprecated
Deprecated

(Since version Use zio.ZIOAppDefault) 2.0.0

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. App
  2. BootstrapRuntime
  3. ZApp
  4. ZBootstrapRuntime
  5. Runtime
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def run(args: List[String]): URIO[zio.ZEnv, ExitCode]

    The main function of the application, which will be passed the command-line arguments to the program and has to return an IO with the errors fully handled.

    The main function of the application, which will be passed the command-line arguments to the program and has to return an IO with the errors fully handled.

    Definition Classes
    ZApp

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def as[R1](r1: R1): Runtime[R1]

    Constructs a new Runtime with the specified new environment.

    Constructs a new Runtime with the specified new environment.

    Definition Classes
    Runtime
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def defaultUnsafeRunSync[E, A](zio: => ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): Exit[E, A]
    Attributes
    protected
    Definition Classes
    Runtime
  8. def environment: zio.ZEnv

    The environment of the runtime.

    The environment of the runtime.

    Definition Classes
    BootstrapRuntimeRuntime
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. final def main(args0: Array[String]): Unit

    The Scala main function, intended to be called only by the Scala runtime.

    The Scala main function, intended to be called only by the Scala runtime.

    Definition Classes
    ZApp
  16. def map[R1](f: (zio.ZEnv) => R1): Runtime[R1]

    Constructs a new Runtime by mapping the environment.

    Constructs a new Runtime by mapping the environment.

    Definition Classes
    Runtime
  17. def mapRuntimeConfig(f: (RuntimeConfig) => RuntimeConfig): Runtime[zio.ZEnv]

    Constructs a new Runtime by mapping the runtime configuration.

    Constructs a new Runtime by mapping the runtime configuration.

    Definition Classes
    Runtime
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def run[E, A](zio: ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): IO[E, A]

    Runs the effect "purely" through an async boundary.

    Runs the effect "purely" through an async boundary. Useful for testing.

    Definition Classes
    Runtime
  22. def runtimeConfig: RuntimeConfig

    The configuration of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.

    The configuration of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.

    Definition Classes
    ZBootstrapRuntimeRuntime
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. def tryFastUnsafeRunSync[E, A](zio: ZIO[zio.ZEnv, E, A], stack: Int)(implicit trace: ZTraceElement): Exit[E, A]
    Attributes
    protected
    Definition Classes
    Runtime
  26. final def unsafeRun[E, A](zio: => ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): A

    Executes the effect synchronously, failing with zio.FiberFailure if there are any errors.

    Executes the effect synchronously, failing with zio.FiberFailure if there are any errors. May fail on Scala.js if the effect cannot be entirely run synchronously.

    This method is effectful and should only be done at the edges of your program.

    Definition Classes
    Runtime
  27. final def unsafeRunAsync[E, A](zio: ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): Unit

    Executes the effect asynchronously, discarding the result of execution.

    Executes the effect asynchronously, discarding the result of execution.

    This method is effectful and should only be invoked at the edges of your program.

    Definition Classes
    Runtime
  28. final def unsafeRunAsyncCancelable[E, A](zio: => ZIO[zio.ZEnv, E, A])(k: (Exit[E, A]) => Any)(implicit trace: ZTraceElement): (FiberId) => Exit[E, A]

    Executes the effect asynchronously, eventually passing the exit value to the specified callback.

    Executes the effect asynchronously, eventually passing the exit value to the specified callback. It returns a callback, which can be used to interrupt the running execution.

    This method is effectful and should only be invoked at the edges of your program.

    Definition Classes
    Runtime
  29. final def unsafeRunAsyncWith[E, A](zio: => ZIO[zio.ZEnv, E, A])(k: (Exit[E, A]) => Any)(implicit trace: ZTraceElement): Unit

    Executes the effect asynchronously, eventually passing the exit value to the specified callback.

    Executes the effect asynchronously, eventually passing the exit value to the specified callback.

    This method is effectful and should only be invoked at the edges of your program.

    Definition Classes
    Runtime
  30. final def unsafeRunSync[E, A](zio0: => ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): Exit[E, A]

    Executes the effect asynchronously, eventually passing the exit value to the specified callback.

    Executes the effect asynchronously, eventually passing the exit value to the specified callback. It returns a callback, which can be used to interrupt the running execution.

    This method is effectful and should only be invoked at the edges of your program.

    Definition Classes
    Runtime
  31. final def unsafeRunTask[A](task: => RIO[zio.ZEnv, A])(implicit trace: ZTraceElement): A

    Executes the Task/RIO effect synchronously, failing with the original Throwable on both Cause.Fail and Cause.Die.

    Executes the Task/RIO effect synchronously, failing with the original Throwable on both Cause.Fail and Cause.Die. In addition, appends a new element to the Throwables "caused by" chain, with this Cause "pretty printed" (in stackless mode) as the message. May fail on Scala.js if the effect cannot be entirely run synchronously.

    This method is effectful and should only be done at the edges of your program.

    Definition Classes
    Runtime
  32. final def unsafeRunToFuture[E <: Throwable, A](zio: ZIO[zio.ZEnv, E, A])(implicit trace: ZTraceElement): CancelableFuture[A]

    Runs the IO, returning a Future that will be completed when the effect has been executed.

    Runs the IO, returning a Future that will be completed when the effect has been executed.

    This method is effectful and should only be used at the edges of your program.

    Definition Classes
    Runtime
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. def withBlockingExecutor(e: Executor): Runtime[zio.ZEnv]

    Constructs a new Runtime with the specified blocking executor.

    Constructs a new Runtime with the specified blocking executor.

    Definition Classes
    Runtime
  37. def withExecutor(e: Executor): Runtime[zio.ZEnv]

    Constructs a new Runtime with the specified executor.

    Constructs a new Runtime with the specified executor.

    Definition Classes
    Runtime
  38. def withFatal(f: (Throwable) => Boolean): Runtime[zio.ZEnv]

    Constructs a new Runtime with the specified fatal predicate.

    Constructs a new Runtime with the specified fatal predicate.

    Definition Classes
    Runtime
  39. def withReportFatal(f: (Throwable) => Nothing): Runtime[zio.ZEnv]

    Constructs a new Runtime with the fatal error reporter.

    Constructs a new Runtime with the fatal error reporter.

    Definition Classes
    Runtime
  40. def withTracing(t: Tracing): Runtime[zio.ZEnv]

    Constructs a new Runtime with the specified tracer and tracing configuration.

    Constructs a new Runtime with the specified tracer and tracing configuration.

    Definition Classes
    Runtime

Deprecated Value Members

  1. def mapPlatform(f: (Platform) => Platform): Runtime[zio.ZEnv]

    Constructs a new Runtime by mapping the platform.

    Constructs a new Runtime by mapping the platform.

    Definition Classes
    Runtime
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapRuntimeConfig

  2. def platform: Platform

    The platform of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.

    The platform of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.

    Definition Classes
    Runtime
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use runtimeConfig

Inherited from BootstrapRuntime

Inherited from ZApp[zio.ZEnv]

Inherited from ZBootstrapRuntime[zio.ZEnv]

Inherited from Runtime[zio.ZEnv]

Inherited from AnyRef

Inherited from Any

Ungrouped