Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

Runtime.ts overview

Since v1.0.0


Exports Grouped by Category


constructors

makeRunMain

Signature

declare const makeRunMain: (
  f: <E, A>(options: { readonly fiber: Fiber.RuntimeFiber<A, E>; readonly teardown: Teardown }) => void
) => RunMain

Source

Since v1.0.0

model

RunMain (interface)

Signature

export interface RunMain {
  /**
   * Helps you run a main effect with built-in error handling, logging, and signal management.
   *
   * **Details**
   *
   * This function launches an Effect as the main entry point, setting exit codes
   * based on success or failure, handling interrupts (e.g., Ctrl+C), and optionally
   * logging errors. By default, it logs errors and uses a "pretty" format, but both
   * behaviors can be turned off. You can also provide custom teardown logic to
   * finalize resources or produce different exit codes.
   *
   * **Options**
   *
   * An optional object that can include:
   * - `disableErrorReporting`: Turn off automatic error logging.
   * - `disablePrettyLogger`: Avoid adding the pretty logger.
   * - `teardown`: Provide custom finalization logic.
   *
   * **When to Use**
   *
   * Use this function to run an Effect as your application’s main program, especially
   * when you need structured error handling, log management, interrupt support,
   * or advanced teardown capabilities.
   */
  (options?: {
    readonly disableErrorReporting?: boolean | undefined
    readonly disablePrettyLogger?: boolean | undefined
    readonly teardown?: Teardown | undefined
  }): <E, A>(effect: Effect.Effect<A, E>) => void
  /**
   * Helps you run a main effect with built-in error handling, logging, and signal management.
   *
   * **Details**
   *
   * This function launches an Effect as the main entry point, setting exit codes
   * based on success or failure, handling interrupts (e.g., Ctrl+C), and optionally
   * logging errors. By default, it logs errors and uses a "pretty" format, but both
   * behaviors can be turned off. You can also provide custom teardown logic to
   * finalize resources or produce different exit codes.
   *
   * **Options**
   *
   * An optional object that can include:
   * - `disableErrorReporting`: Turn off automatic error logging.
   * - `disablePrettyLogger`: Avoid adding the pretty logger.
   * - `teardown`: Provide custom finalization logic.
   *
   * **When to Use**
   *
   * Use this function to run an Effect as your application’s main program, especially
   * when you need structured error handling, log management, interrupt support,
   * or advanced teardown capabilities.
   */
  <E, A>(
    effect: Effect.Effect<A, E>,
    options?: {
      readonly disableErrorReporting?: boolean | undefined
      readonly disablePrettyLogger?: boolean | undefined
      readonly teardown?: Teardown | undefined
    }
  ): void
}

Source

Since v1.0.0

Teardown (interface)

Signature

export interface Teardown {
  <E, A>(exit: Exit.Exit<E, A>, onExit: (code: number) => void): void
}

Source

Since v1.0.0

teardown

defaultTeardown

Signature

declare const defaultTeardown: Teardown

Source

Since v1.0.0