constellation/worker_pool/types

Canonical public values for worker pools.

Types

Invalid worker pool settings.

pub type ConfigError {
  InvalidSize(Int)
  InvalidPrefetch(Int)
  InvalidTimeout(Int)
  InvalidBufferCapacity(Int)
}

Constructors

  • InvalidSize(Int)
  • InvalidPrefetch(Int)
  • InvalidTimeout(Int)
  • InvalidBufferCapacity(Int)

Lifecycle and processing events emitted asynchronously by a pool.

pub type Event {
  WorkerStarted(id: WorkerId, slot: Int)
  WorkerStopped(id: WorkerId, slot: Int)
  WorkerReplaced(
    previous: WorkerId,
    replacement: WorkerId,
    slot: Int,
  )
  BatchStarted(id: WorkerId, event_count: Int)
  BatchCompleted(id: WorkerId, event_count: Int)
  PoolStopping
  PoolStopped
}

Constructors

  • WorkerStarted(id: WorkerId, slot: Int)
  • WorkerStopped(id: WorkerId, slot: Int)
  • WorkerReplaced(
      previous: WorkerId,
      replacement: WorkerId,
      slot: Int,
    )
  • BatchStarted(id: WorkerId, event_count: Int)
  • BatchCompleted(id: WorkerId, event_count: Int)
  • PoolStopping
  • PoolStopped

Runtime errors returned by pool operations.

pub type PoolError {
  PoolUnavailable
  PoolTimeout
  AlreadyStopping
  SourceManaged
  StageProtocol(stage_error.StageError)
}

Constructors

Current observable pool state.

pub type Snapshot {
  Snapshot(
    workers: List(WorkerId),
    buffered_events: Int,
    stopping: Bool,
  )
}

Constructors

  • Snapshot(
      workers: List(WorkerId),
      buffered_events: Int,
      stopping: Bool,
    )

Errors that can prevent a pool from starting.

pub type StartError {
  InvalidConfig(ConfigError)
  ActorStart(actor.StartError)
}

Constructors

Stable identity assigned to one worker incarnation.

pub opaque type WorkerId

Values

pub fn worker_id_to_int(id: WorkerId) -> Int
Search Document