Main

app.Main
object Main extends IOApp

Main entry point for the application.

This object configures and starts all required resources and services for the application, including:

  • Actor system setup for Akka-based concurrency.
  • HTTP client setup for external API interactions.
  • Distributed cache management with separate time-to-live (TTL) settings for local and distributed caches.
  • Initialisation of core services (MechanismService, ReactionService, ReaktoroService).
  • HTTP server setup for serving API endpoints.

Proper lifecycle management is ensured using cats.effect.Resource, which guarantees that all resources are initialised and cleaned up correctly. This entry point waits for user input to terminate the application, ensuring a controlled shutdown.

Attributes

Source
Main.scala
Graph
Supertypes
trait IOApp
class Object
trait Matchable
class Any
Self type
Main.type

Members list

Value members

Concrete methods

override def run(args: List[String]): IO[ExitCode]

Main entry point for the application.

Main entry point for the application.

This method sets up the application by:

  • Initialising implicit dependencies, including the logger, actor system, execution context, distributed data, unique address, and cache expiration time-to-live (TTL) settings for local and distributed caches.
  • Loading configuration using the DefaultConfigLoader.
  • Running the application using runApp and ensuring all resources are cleaned up on exit.

Value parameters

args

The command-line arguments passed to the application.

Attributes

Returns

An IO[ExitCode] indicating the application's final exit code upon completion.

Definition Classes
Source
Main.scala

Inherited methods

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

Attributes

Inherited from:
IOApp
Source
IOApp.scala