UNPKG

@dtu-olp-2024/kafka-nocobase

Version:

A NocoBase plugin for Apache Kafka integration, supporting message publishing, topic management, and event-driven workflows. Built for the DTU GreenHope project.

24 lines (20 loc) 375 B
let id = 0 const nextId = () => { if (id === Number.MAX_VALUE) { id = 0 } return id++ } class InstrumentationEvent { /** * @param {String} type * @param {Object} payload */ constructor(type, payload) { this.id = nextId() this.type = type this.timestamp = Date.now() this.payload = payload } } module.exports = InstrumentationEvent