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

DurableExecutionEvent overview

Added in v1.0.0


Table of contents


utils

Attempted

Signature

export declare function Attempted(version: string)

Added in v1.0.0

Attempted (interface)

Signature

export interface Attempted {
  _tag: typeof ATTEMPTED
  sequence: number
  version: string
}

Added in v1.0.0

Completed

Signature

export declare function Completed<A, E>(exit: Exit.Exit<A, E>)

Added in v1.0.0

Completed (interface)

Signature

export interface Completed<A, E> {
  _tag: typeof COMPLETED
  sequence: number
  exit: Exit.Exit<A, E>
}

Added in v1.0.0

DurableExecutionEvent (type alias)

Signature

export type DurableExecutionEvent<A, E> = Attempted | InterruptionRequested | Completed<A, E> | Forked | Joined

Added in v1.0.0

DurableExecutionEventFrom (type alias)

Signature

export type DurableExecutionEventFrom<IE, IA> =
  | {
      readonly _tag: typeof ATTEMPTED
      readonly sequence: number
      readonly version: string
    }
  | {
      readonly _tag: typeof INTERRUPTION_REQUESTED
      readonly sequence: number
    }
  | {
      readonly _tag: typeof COMPLETED
      readonly sequence: number
      readonly exit: Schema.ExitEncoded<IE, IA, unknown>
    }
  | {
      readonly _tag: typeof FORKED
      readonly sequence: number
      readonly persistenceId: string
    }
  | {
      readonly _tag: typeof JOINED
      readonly sequence: number
      readonly persistenceId: string
    }

Added in v1.0.0

Forked

Signature

export declare function Forked(persistenceId: string)

Added in v1.0.0

Forked (interface)

Signature

export interface Forked {
  _tag: typeof FORKED
  sequence: number
  persistenceId: string
}

Added in v1.0.0

InterruptionRequested (interface)

Signature

export interface InterruptionRequested {
  _tag: typeof INTERRUPTION_REQUESTED
  sequence: number
}

Added in v1.0.0

Joined

Signature

export declare function Joined(persistenceId: string)

Added in v1.0.0

Joined (interface)

Signature

export interface Joined {
  _tag: typeof JOINED
  sequence: number
  persistenceId: string
}

Added in v1.0.0

KillRequested

Signature

export declare function KillRequested(sequence: number): DurableExecutionEvent<never, never>

Added in v1.0.0

match

Signature

export declare function match<A, E, B, C = B, D = C, F = D, G = F>(
  event: DurableExecutionEvent<A, E>,
  fns: {
    onAttempted: (event: Attempted) => B
    onInterruptionRequested: (event: InterruptionRequested) => C
    onCompleted: (event: Completed<A, E>) => D
    onForked: (event: Forked) => F
    onJoined: (event: Joined) => G
  }
)

Added in v1.0.0

schema

Signature

export declare function schema<A, IA, E, IE>(
  success: Schema.Schema<A, IA>,
  failure: Schema.Schema<E, IE>
): Schema.Schema<DurableExecutionEvent<A, E>, DurableExecutionEventFrom<IA, IE>>

Added in v1.0.0