The reactive runtime: events, functions and streams
The Kafka-style event mesh, the drift-corrected functions runtime and SSE streams — the three reactive systems inside the Link Loom SDK.
A runtime that only answers HTTP requests is half a runtime. The other half is everything that happens between requests: the event that fans out to three services, the report that runs every morning at nine, the progress bar a user watches while a build streams. Link Loom ships all three as first-class adapters.
Two layers of events — never a distributed monolith
The event system is deliberately split in two, so local coupling never leaks into domain coupling:
Layer 1 — the internal bus. An in-process EventEmitter measured in microseconds. When your UserService emits user.created and your notification logic reacts in the same process, no broker is involved. Reactivity without infrastructure.
Layer 2 — the broker, Kafka pattern. For everything that crosses a process boundary, Loom adopts the producer–broker–consumer architecture: producers fire events with a topic and routing key; the broker (RabbitMQ, Redis Streams) guarantees durability, routing and backpressure; consumers process and ack — or nack, and the message retries. Neither side knows the other exists. That location transparency is what lets one node cluster serve a real-time chat where the message enters through node 1 and exits through node 2.
The contract lives in a declarative manifest — src/events/index.js declares every topic your service produces to and every event it consumes. Your event IO is reviewable in one file, in one PR.
Functions — the job runner you stop writing
Every backend grows three kinds of “not-a-request” logic, and the Functions adapter names them:
- Timed functions replace the external crontab with a drift-corrected scheduler: it aligns to the next
startAtwith a precise delta, then locks the cadence. Daily digests, hourly aggregations, cleanup jobs — a class with arun()method. - Startup functions gate the boot. Blocking mode (
atTime) refuses to accept traffic until migrations run or the database answers; async mode (onServerLoaded) seeds and warms caches after the server is up. “Works after the second restart” stops being a genre of bug. - Cache functions are stateful singletons — structured in-memory stores for feature flags, reference data or a loaded ML model, without polluting globals.
SSE streams — progress you can watch
The streams adapter pushes server-sent events to any client with plain HTTP. It is the quiet workhorse behind the platform’s own surfaces: cloud builds in App Studio stream their phases live into the editor through this exact adapter. When your product needs a progress bar, a live log or a ticking metric, the stream is already in the box.
Three systems, one dependency graph, zero extra frameworks. That is what “reactive” means here: not a paradigm essay — infrastructure that reacts.