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

ShardStorage.ts overview

Since v1.0.0


Exports Grouped by Category


Encoded

Encoded (interface)

Signature

export interface Encoded {
  /**
   * Get the current assignments of shards to runners.
   */
  readonly getAssignments: Effect.Effect<
    Array<readonly [shardId: number, runnerAddress: string | null]>,
    PersistenceError
  >

  /**
   * Save the current state of shards assignments to runners.
   */
  readonly saveAssignments: (
    assignments: Array<readonly [shardId: number, RunnerAddress: string | null]>
  ) => Effect.Effect<void, PersistenceError>

  /**
   * Get all runners registered with the cluster.
   */
  readonly getRunners: Effect.Effect<Array<readonly [address: string, runner: string]>, PersistenceError>

  /**
   * Save the current runners registered with the cluster.
   */
  readonly saveRunners: (
    runners: Array<readonly [address: string, runner: string]>
  ) => Effect.Effect<void, PersistenceError>

  /**
   * Acquire the lock on the given shards, returning the shards that were
   * successfully locked.
   */
  readonly acquire: (address: string, shardIds: ReadonlyArray<number>) => Effect.Effect<Array<number>, PersistenceError>

  /**
   * Refresh the lock on the given shards, returning the shards that were
   * successfully locked.
   */
  readonly refresh: (address: string, shardIds: ReadonlyArray<number>) => Effect.Effect<Array<number>, PersistenceError>

  /**
   * Release the lock on the given shards.
   */
  readonly release: (address: string, shardIds: number) => Effect.Effect<void, PersistenceError>

  /**
   * Release the lock on all shards for the given runner.
   */
  readonly releaseAll: (address: string) => Effect.Effect<void, PersistenceError>
}

Source

Since v1.0.0

constructors

makeMemory

Signature

declare const makeMemory: any

Source

Since v1.0.0

layers

layerMemory

Signature

declare const layerMemory: Layer.Layer<ShardStorage>

Source

Since v1.0.0

layerNoop

Signature

declare const layerNoop: Layer.Layer<ShardStorage>

Source

Since v1.0.0

makeEncoded

Signature

declare const makeEncoded: any

Source

Since v1.0.0

models

ShardStorage (class)

Represents a generic interface to the persistent storage required by the cluster.

Signature

declare class ShardStorage

Source

Since v1.0.0