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
- The ZIO Effect
- Composing ZIO
- Error and Dependency Channels
- Running ZIO Apps