Jido.Sensors.Heartbeat (Jido v2.0.0-rc.1)

View Source

A sensor that emits heartbeat signals at configurable intervals.

Configuration

  • interval - Interval between heartbeats in milliseconds (default: 5000)
  • message - Message to include in heartbeat signal (default: "heartbeat")

Example

# Start via SensorServer
{:ok, pid} = Jido.Sensor.Runtime.start_link(
  sensor: Jido.Sensors.Heartbeat,
  config: %{interval: 1000, message: "alive"}
)

Summary

Functions

Returns metadata for Jido.Discovery integration.

Returns the sensor's description.

Returns the sensor's name.

Returns the Zoi schema for sensor configuration.

Returns the sensor specification.

Functions

__sensor_metadata__()

@spec __sensor_metadata__() :: map()

Returns metadata for Jido.Discovery integration.

This function is used by Jido.Discovery to index sensors for fast lookup and filtering.

description()

@spec description() :: String.t() | nil

Returns the sensor's description.

name()

@spec name() :: String.t()

Returns the sensor's name.

schema()

@spec schema() :: Zoi.schema() | nil

Returns the Zoi schema for sensor configuration.

spec()

@spec spec() :: Jido.Sensor.Spec.t()

Returns the sensor specification.

The spec contains all metadata needed to configure and run the sensor.