Skip to main content

Heartbeat Worker

A simple test worker used to verify that the worker system is functioning correctly.

Included in Base Preset

This plugin is part of the base preset and loaded automatically. Using the base preset is strongly recommended, so explicit installation is usually not required.

Installation

import '@unchainedshop/plugins/worker/heartbeat';

Purpose

The Heartbeat Worker is primarily used for:

  • Testing that the worker queue is processing jobs
  • Debugging worker system issues
  • Health checks in monitoring systems
  • Simulating work delays for testing

Usage

Create a heartbeat work item:

mutation TestWorker {
createWork(
type: "HEARTBEAT"
input: {
wait: 1000, # Optional: milliseconds to wait before completing
fails: false # Optional: set to true to simulate a failure
}
) {
_id
status
}
}

Input Parameters

ParameterTypeDefaultDescription
waitNumber-Milliseconds to wait before completing
failsBooleanfalseIf true, the work will fail instead of succeed

Adapter Details

PropertyValue
Keyshop.unchained.worker-plugin.heartbeat
TypeHEARTBEAT
Max Parallel1
Sourceworker/heartbeat.ts