Skip to main content Link Search Menu Expand Document (external link)

CrashableRuntime overview

Added in v1.0.0


Table of contents


utils

CrashableRuntime (interface)

Signature

export interface CrashableRuntime {
  /**
   * @since 1.0.0
   */
  crash: Effect.Effect<void>

  /**
   * @since 1.0.0
   */
  run: <A, E, R>(
    fn: (restore: <A2, E2, R2>(fa: Effect.Effect<A2, E2, R2>) => Effect.Effect<A2, E2, R2>) => Effect.Effect<A, E, R>
  ) => Effect.Effect<A, E | CrashableRuntimeCrashedError, R>
}

Added in v1.0.0

CrashableRuntimeCrashedError (class)

Signature

export declare class CrashableRuntimeCrashedError

Added in v1.0.0

CrashableRuntimeScheduler (class)

Signature

export declare class CrashableRuntimeScheduler { constructor(readonly baseScheduler: Scheduler.Scheduler) }

Added in v1.0.0

shouldYield (method)

Signature

shouldYield(fiber: RuntimeFiber<unknown, unknown>): number | false

Added in v1.0.0

scheduleTask (method)

Signature

scheduleTask(task: Scheduler.Task, priority: number): void

Added in v1.0.0

crash (method)

Signature

crash()

Added in v1.0.0

crashed (property)

Signature

crashed: boolean

Added in v1.0.0

isCrashableRuntimeCrashedError

Signature

export declare function isCrashableRuntimeCrashedError(value: unknown): value is CrashableRuntimeCrashedError

Added in v1.0.0

make

Signature

export declare const make: any

Added in v1.0.0

retryWhileCrashes

Signature

export declare function retryWhileCrashes<R, E, A>(
  fn: (runtime: CrashableRuntime) => Effect.Effect<R, E | CrashableRuntimeCrashedError, A>
): Effect.Effect<R, Exclude<E, CrashableRuntimeCrashedError>, A>

Added in v1.0.0

runWithCrash

Signature

export declare function runWithCrash<R, E, A>(
  fn: (crash: Effect.Effect<never>) => Effect.Effect<R, E | CrashableRuntimeCrashedError, A>
): Effect.Effect<R, E | CrashableRuntimeCrashedError, A>

Added in v1.0.0