OxApp

ox.OxApp
See theOxApp companion object
trait OxApp

Extend this trait when defining application entry points. Comes in several variants:

The benefit of using OxApp compared to normal @main methods is that application interruptions is handled properly. A fork in a scope is created to run the application's logic. Interrupting the application (by sending SIGINT/SIGTERM, e.g. using CTRL+C) will cause the scope to end and all forks to be interrupted, allowing for a clean shutdown.

That way, any resources that have been allocated and attached to scopes, or that are managed using try-finally blocks inside forks, will be released properly.

Certain aspects of exception handling can be configured using OxApp.Settings and overriding the settings method.

The application's code is specified in a run method, which has two capabilities granted:

  • Ox, to fork asynchronously computations, and register clean up of resources
  • IO, to perform I/O operations

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Simple
trait WithErrorMode[E, F]
class WithEitherErrors[E]

Members list

Value members

Abstract methods

def run(args: Vector[String])(using Ox, IO): ExitCode

Concrete methods

final def main(args: Array[String]): Unit