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

PodsHealth overview

Added in v1.0.0


Table of contents


constructors

make

Constructs a PodsHealth from its implementation

Signature

export declare const make: (args: Omit<PodsHealth, typeof PodsHealthTypeId>) => PodsHealth

Added in v1.0.0

context

PodsHealth

Signature

export declare const PodsHealth: Context.Tag<PodsHealth, PodsHealth>

Added in v1.0.0

layers

local

A layer that pings the pod directly to check if it’s alive. This is useful for developing and testing but not reliable in production.

Signature

export declare const local: Layer.Layer<PodsHealth, never, Pods.Pods>

Added in v1.0.0

noop

A layer that considers pods as always alive. This is useful for testing only.

Signature

export declare const noop: Layer.Layer<PodsHealth>

Added in v1.0.0

models

PodsHealth (interface)

An interface to check a pod’s health. This is used when a pod is unresponsive, to check if it should be unassigned all its shards or not. If the pod is alive, shards will not be unassigned because the pods might still be processing messages and might be responsive again. If the pod is not alive, shards can be safely reassigned somewhere else. A typical implementation for this is using k8s to check if the pod still exists.

Signature

export interface PodsHealth {
  /**
   * @since 1.0.0
   */
  readonly [PodsHealthTypeId]: PodsHealthTypeId

  /**
   * Check if a pod is still alive.
   * @since 1.0.0
   */
  readonly isAlive: (podAddress: PodAddress.PodAddress) => Effect.Effect<boolean>
}

Added in v1.0.0

symbols

PodsHealthTypeId

Signature

export declare const PodsHealthTypeId: typeof PodsHealthTypeId

Added in v1.0.0

PodsHealthTypeId (type alias)

Signature

export type PodsHealthTypeId = typeof PodsHealthTypeId

Added in v1.0.0