mqtt-ingest draft

This commit is contained in:
Nikita Bizyaev
2026-06-04 14:40:18 +03:00
commit e7b44539ae
27 changed files with 1492 additions and 0 deletions

18
app/src/registry.ts Normal file
View File

@@ -0,0 +1,18 @@
import type { TopicHandler } from './types.js'
const handlers = new Map<string, TopicHandler>()
export function register(topic: string, handler: TopicHandler): void {
if (handlers.has(topic)) {
throw new Error(`Handler already registered for topic: ${topic}`)
}
handlers.set(topic, handler)
}
export function getHandler(topic: string): TopicHandler | undefined {
return handlers.get(topic)
}
export function getRegisteredTopics(): string[] {
return [...handlers.keys()]
}