Skip to content

index

@fungi.computer/watchdog


@fungi.computer/watchdog / index

Typed failures owned by the generic Watchdog engine.

  • Error

new WatchdogError(cause): WatchdogError

"store_unavailable" | "store_invalid" | "claim_unavailable" | "execution_failed" | "settlement_rejected" | "wake_unavailable"

WatchdogError

Error.constructor

readonly _tag: "WatchdogError"

readonly cause: "store_unavailable" | "store_invalid" | "claim_unavailable" | "execution_failed" | "settlement_rejected" | "wake_unavailable"

Error.cause

WatchdogExecutor = (job, signal) => Promise<WatchdogExecutionDecision>>

Promise host executor for one generic running job.

WatchdogRunningJob

AbortSignal

Promise<WatchdogExecutionDecision>


WatchdogOptions = Readonly<{ owner: WatchdogSqliteOwner; isAlive: (job) => Promise<boolean>>; execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>>; }>; }>

Options for constructing the Promise facade.


WatchdogRuntime = Readonly<{ hasPendingWork: () => Promise<boolean>>; ingest: (job) => Promise<WatchdogIngestResult>>; read: (jobId) => Promise<WatchdogReadResult>>; readQueueHead: (queue) => Promise<WatchdogQueueHead>>; tick: () => Promise<WatchdogTickResult>>; cancel: (input) => Promise<WatchdogCancellationResult>>; purge: (queue) => Promise<void>>; transactional: WatchdogTransactionalProjection; }>

Promise facade over the canonical Effect runtime.


WatchdogApi = Readonly<{ make: (options) => Promise<WatchdogRuntime>>; }>

Factory for the Promise facade.

const Watchdog: WatchdogApi

Promise facade over the canonical Effect-owned runtime.

Re-exports WatchdogCancellationIntentSchema


Re-exports WatchdogCancellationResultSchema


Re-exports WatchdogExecutionDecisionSchema


Re-exports WatchdogIngestResultSchema


Re-exports WatchdogQueuedJobSchema


Re-exports WatchdogQueueHeadSchema


Re-exports WatchdogReadResultSchema


Re-exports WatchdogRunningJobSchema


Re-exports WatchdogSettledJobSchema


Re-exports WatchdogStoredJobSchema


Re-exports EffectWatchdogOptions


Re-exports EffectWatchdogExecutor


Re-exports WatchdogCancellationDecision


Re-exports WatchdogCancellationIntent


Re-exports WatchdogCancellationResult


Re-exports WatchdogExecutionDecision


Re-exports WatchdogIngestResult


Re-exports WatchdogQueuedJob


Re-exports WatchdogQueueHead


Re-exports WatchdogReadResult


Re-exports WatchdogRunningJob


Re-exports WatchdogRuntimeEffect


Re-exports WatchdogSettledJob


Re-exports WatchdogSqliteCursor


Re-exports WatchdogSqliteOwner


Re-exports WatchdogSqliteValue


Re-exports WatchdogStoredJob


Re-exports WatchdogTickResult


Re-exports WatchdogTransactionalProjection