Hyperlinkv0.9.0-beta.0

WorkPool

WorkPool.queueEntryconstsrc/WorkPool.ts:295
<Sch extends Schema.Top>(itemSchema: Sch): Schema.Struct<{
  readonly item: Sch
  readonly entryId: Schema.String
  readonly key: Schema.optional<Schema.String>
  readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>
  readonly attempts: Schema.Number
  readonly timestamps: Schema.Struct<{
    readonly enqueuedAt: Schema.DateTimeUtc
    readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>
    readonly completedAt: Schema.optionalKey<Schema.DateTimeUtc>
    readonly interruptedAt: Schema.optionalKey<Schema.DateTimeUtc>
  }>
  readonly batchId: Schema.optional<Schema.String>
  readonly releaseId: Schema.optional<Schema.String>
  readonly sourceHyperlinkId: Schema.optional<Schema.String>
  readonly attributes: Schema.optional<
    Schema.$Record<Schema.String, Schema.Unknown>
  >
}>

A queue entry on the wire, parameterized by the per-instance itemSchema. Mirrors the engine's QueueEntry<T>; used inside queueEvent.

wire schemasqueueEvent
Source src/WorkPool.ts:29517 lines
export const queueEntry = <Sch extends Schema.Top>(itemSchema: Sch) =>
  Schema.Struct({
    item: itemSchema,
    entryId: Schema.String,
    // `optional` (not `optionalKey`): the engine emits `key: undefined` explicitly when no dedup
    // key, so the wire schema must accept a present-but-undefined value (else encode fails on RPC).
    key: Schema.optional(Schema.String),
    priority: queuePriority,
    attempts: Schema.Number,
    timestamps: queueEntryTimestamps,
    // `optional` (not `optionalKey`): the engine's `release`/route paths spread metadata that may
    // hold present-but-`undefined` values, so the wire schema must accept them (else encode fails).
    batchId: Schema.optional(Schema.String),
    releaseId: Schema.optional(Schema.String),
    sourceHyperlinkId: Schema.optional(Schema.String),
    attributes: Schema.optional(queueEntryAttributes),
  });
Referenced by 1 symbols