Produces the IO
to be run as an app.
Produces the IO
to be run as an app.
the cats.effect.ExitCode the JVM exits with
Provides an implicit ContextShift for the app.
Provides an implicit ContextShift for the app.
The default is lazily constructed from the global execution context
(i.e. scala.concurrent.ExecutionContext.Implicits.global
).
Users can override this value in order to customize the main thread-pool on top of the JVM, or to customize the run-loop on top of JavaScript.
The main method that runs the IO
returned by run and exits
the app with the resulting code on completion.
Provides an implicit Timer for the app.
Provides an implicit Timer for the app.
Users can override this value in order to customize the underlying scheduler being used.
The default on top of the JVM uses an internal scheduler built with Java's
Executors.newScheduledThreadPool
(configured with one or two threads) and that defers the execution of the
scheduled ticks (the bind continuations get shifted) to Scala's global
.
On top of JavaScript the default timer will simply use the standard setTimeout.
App
type that runs a cats.effect.IO. Shutdown occurs after theIO
completes, as follows:- If completed with
ExitCode.Success
, the main method exits and shutdown is handled by the platform.- If completed with any other ExitCode,
sys.exit
is called with the specified code.- If the
IO
raises an error, the stack trace is printed to standard error andsys.exit(1)
is called.When a shutdown is requested via a signal, the
IO
is canceled and we wait for theIO
to release any resources. The process exits with the numeric value of the signal plus 128.