Main

marola.Main
object Main extends KyoApp

POC entry point for marola, the ocean intelligence layer — its first case, "what's the best hour tomorrow to swim nearby?".

Attributes

Graph
Supertypes
class KyoApp
class KyoAppPlatformSpecific
trait KyoAppRunnerPlatform
trait KyoAppRunnerWithInterrupts
trait KyoAppRunner
class Base[Async & Scope & Abort[Any]]
class Object
trait Matchable
class Any
Show all
Self type
Main.type

Members list

Value members

Inherited methods

final protected def args: Chunk[String]

The argument(s) this application was started with.

The argument(s) this application was started with.

Attributes

Inherited from:
Base
protected def exit(code: Int)(using AllowUnsafe): Unit

Unsafely exits the application.

Unsafely exits the application.

Attributes

Inherited from:
Base
final override protected def exitHook(code: Int)(using AllowUnsafe): Unit

Unsafely exits the process on non-throwable failures (onResult).

Unsafely exits the process on non-throwable failures (onResult).

Attributes

Definition Classes
KyoAppPlatformSpecific -> KyoAppRunner
Inherited from:
KyoAppPlatformSpecific
final override protected def handle[A](v: A < (Async & Scope & Abort[Any]))(using Frame): A < (Async & Abort[Throwable])

Wraps an effect for execution (interrupts, scope, etc.).

Wraps an effect for execution (interrupts, scope, etc.).

Attributes

Definition Classes
KyoAppRunnerWithInterrupts -> KyoAppRunner
Inherited from:
KyoAppRunnerWithInterrupts
protected def handleWithInterrupts[A](v: A < (Async & Abort[Throwable]))(using Frame): A < (Async & Abort[Throwable])

Attributes

Inherited from:
KyoAppInterrupts (hidden)
final def main(args: Array[String]): Unit

Attributes

Inherited from:
Base
final override protected def normalTermination(e: Throwable)(using AllowUnsafe): Maybe[Int]

The exit code for a termination the runner treats as normal, when this is one.

The exit code for a termination the runner treats as normal, when this is one.

An operator stopping the process is not a fault, so it must not be rendered, must not throw, and must not exit as a failure would. The default recognises none; KyoAppRunnerWithInterrupts recognises the interrupt it raised for a signal.

Attributes

Definition Classes
KyoAppRunnerWithInterrupts -> KyoAppRunner
Inherited from:
KyoAppRunnerWithInterrupts
final protected def onResult[E, A](result: Result[E, A])(using Render[Result[E, A]], AllowUnsafe): Unit

Handles the result of a registered effect block.

Handles the result of a registered effect block.

A termination normalTermination recognises is reported by neither channel: it renders nothing and exits with the code that supplies. An operator stopping the process is not a fault, so rendering and rethrowing it puts a stack-trace-shaped line on stderr for every ordinary stop.

Otherwise a value is rendered to standard output and a failure to standard error. The split is what an application's stdout contract requires: stdout is the program's output, and a failure is a diagnostic about the program, not output from it. A stdio server makes the cost of getting this wrong concrete, since every startup failure (a bad URL, a database refusing connections, a missing environment variable) put a non-JSON line on the very channel its host was parsing, and the host's first read of the connection was garbage. No discipline in the run block avoids it: this is the framework's own terminal reporting, reached by any failure the block does not catch. Every other application type wants the same split for the same reason, which is why IOApp reports an unhandled error to System.err.

A Throwable failure is rendered here and then rethrown, so the runtime's uncaught handler reports it a second time with its stack. Both copies land on standard error, and the second carries strictly more than the first.

Attributes

Inherited from:
KyoAppRunner
final protected def registerEffect[A](effect: => A < (Async & Scope & Abort[Any]))(using Frame, Render[A]): Unit

Registers an effect to run when KyoAppRunner.runInitCode executes.

Registers an effect to run when KyoAppRunner.runInitCode executes.

Attributes

Inherited from:
KyoAppRunnerPlatform
final override protected def run[A](v: => A < (Async & Scope & Abort[Any]))(using Frame, Render[A]): Unit

The main entrypoint to this application.

The main entrypoint to this application.

Attributes

Definition Classes
KyoAppPlatformSpecific -> Base
Inherited from:
KyoAppPlatformSpecific
final protected def runInitCode(): Unit

Runs all registered thunks in order.

Runs all registered thunks in order.

Activation of the stats service providers happens first, so a classpath-present collector (kyo-stats-machine's host sampler, kyo-stats-otlp's exporter) is running before the application's own code starts producing the metrics it would otherwise miss. This is the entrypoint every kyo application funnels through, which is what makes classpath presence alone enough to activate.

Attributes

Inherited from:
KyoAppRunner
protected def runTimeout: Duration

The timeout for each registered effect block.

The timeout for each registered effect block.

Attributes

Inherited from:
KyoAppRunner

Inherited fields

protected var initCode: Chunk[() => Unit]

Thunks executed in registration order when the entrypoint runs.

Thunks executed in registration order when the entrypoint runs.

Attributes

Inherited from:
KyoAppRunner