RunnerStorage.ts overview
Since v1.0.0
Exports Grouped by Category
Encoded
Encoded (interface)
Signature
export interface Encoded {
  /**
   * Get all runners registered with the cluster.
   */
  readonly getRunners: Effect.Effect<Array<readonly [runner: string, healthy: boolean]>, PersistenceError>
  /**
   * Register a new runner with the cluster.
   */
  readonly register: (address: string, runner: string, healthy: boolean) => Effect.Effect<number, PersistenceError>
  /**
   * Unregister the runner with the given address.
   */
  readonly unregister: (address: string) => Effect.Effect<void, PersistenceError>
  /**
   * Set the health status of the given runner.
   */
  readonly setRunnerHealth: (address: string, healthy: boolean) => Effect.Effect<void, PersistenceError>
  /**
   * Acquire the lock on the given shards, returning the shards that were
   * successfully locked.
   */
  readonly acquire: (address: string, shardIds: NonEmptyArray<string>) => Effect.Effect<Array<string>, PersistenceError>
  /**
   * Refresh the lock on the given shards, returning the shards that were
   * successfully locked.
   */
  readonly refresh: (address: string, shardIds: Array<string>) => Effect.Effect<ReadonlyArray<string>, PersistenceError>
  /**
   * Release the lock on the given shard.
   */
  readonly release: (address: string, shardId: string) => Effect.Effect<void, PersistenceError>
  /**
   * Release the lock on all shards for the given runner.
   */
  readonly releaseAll: (address: string) => Effect.Effect<void, PersistenceError>
}
Since v1.0.0
constructors
makeMemory
Signature
declare const makeMemory: Effect.Effect<
  {
    readonly register: (runner: Runner, healthy: boolean) => Effect.Effect<MachineId.MachineId, PersistenceError>
    readonly unregister: (address: RunnerAddress) => Effect.Effect<void, PersistenceError>
    readonly getRunners: Effect.Effect<Array<readonly [runner: Runner, healthy: boolean]>, PersistenceError>
    readonly setRunnerHealth: (address: RunnerAddress, healthy: boolean) => Effect.Effect<void, PersistenceError>
    readonly acquire: (
      address: RunnerAddress,
      shardIds: Iterable<ShardId>
    ) => Effect.Effect<Array<ShardId>, PersistenceError>
    readonly refresh: (
      address: RunnerAddress,
      shardIds: Iterable<ShardId>
    ) => Effect.Effect<Array<ShardId>, PersistenceError>
    readonly release: (address: RunnerAddress, shardId: ShardId) => Effect.Effect<void, PersistenceError>
    readonly releaseAll: (address: RunnerAddress) => Effect.Effect<void, PersistenceError>
  },
  never,
  never
>
Since v1.0.0
layers
layerMemory
Signature
declare const layerMemory: Layer.Layer<RunnerStorage, never, never>
Since v1.0.0
makeEncoded
Signature
declare const makeEncoded: (encoded: Encoded) => {
  readonly register: (runner: Runner, healthy: boolean) => Effect.Effect<MachineId.MachineId, PersistenceError>
  readonly unregister: (address: RunnerAddress) => Effect.Effect<void, PersistenceError>
  readonly getRunners: Effect.Effect<Array<readonly [runner: Runner, healthy: boolean]>, PersistenceError>
  readonly setRunnerHealth: (address: RunnerAddress, healthy: boolean) => Effect.Effect<void, PersistenceError>
  readonly acquire: (
    address: RunnerAddress,
    shardIds: Iterable<ShardId>
  ) => Effect.Effect<Array<ShardId>, PersistenceError>
  readonly refresh: (
    address: RunnerAddress,
    shardIds: Iterable<ShardId>
  ) => Effect.Effect<Array<ShardId>, PersistenceError>
  readonly release: (address: RunnerAddress, shardId: ShardId) => Effect.Effect<void, PersistenceError>
  readonly releaseAll: (address: RunnerAddress) => Effect.Effect<void, PersistenceError>
}
Since v1.0.0
models
RunnerStorage (class)
Represents a generic interface to the persistent storage required by the cluster.
Signature
declare class RunnerStorage
Since v1.0.0