0Pricing
Scala for Backend Engineering & Functional Programming · Lesson

Running ZIO Apps

ZIOAppDefault.

From Description to Execution

A ZIO value is only a blueprint. To execute it you hand it to the ZIO runtime, usually by extending ZIOAppDefault rather than calling the runtime by hand.

ZIOAppDefault

Extend ZIOAppDefault and implement run. The framework provides default services (Console, Clock, Random, System) and manages startup and shutdown.

import zio._

object Hello extends ZIOAppDefault {
  def run = Console.printLine("Hello, ZIO!")
}

All lessons in this course

  1. The ZIO Effect
  2. Composing ZIO
  3. Error and Dependency Channels
  4. Running ZIO Apps
← Back to Scala for Backend Engineering & Functional Programming