@siglo/monitor 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -283,23 +283,30 @@ When scaling workflows across multiple worker processes or Kubernetes pods, aggr
283
283
 
284
284
  ```typescript
285
285
  import { RedisMonitoringAdapter, createMonitorServer } from '@siglo/monitor';
286
+ import { WorkflowEventEmitter } from '@siglo/core';
287
+ import Redis from 'ioredis';
286
288
 
287
- const redisAdapter = new RedisMonitoringAdapter({
288
- redisUrl: 'redis://localhost:6379',
289
+ const redisUrl = process.env.REDIS_URL || 'redis://localhost:6379';
290
+
291
+ // 1. In Worker Process: Publish events to Redis
292
+ const publisher = new Redis(redisUrl);
293
+ const workerAdapter = new RedisMonitoringAdapter({
294
+ publisher,
289
295
  channel: 'siglo:monitor:events'
290
296
  });
291
297
 
292
- // 1. In Worker Process: Publish events to Redis
293
298
  emitter.on('*', (event) => {
294
- redisAdapter.publish(event);
299
+ workerAdapter.publish(event);
295
300
  });
296
301
 
297
- // 2. In Central Monitor Server: Subscribe and broadcast to web dashboard
302
+ // 2. In Central Monitor Server: Ingest events via subscriber and deliver to server emitter
303
+ const subscriber = new Redis(redisUrl);
298
304
  const monitor = await createMonitorServer({ port: 4000 });
299
305
 
300
- redisAdapter.subscribe((event) => {
301
- monitor.store.addEvent(event);
302
- monitor.sse.broadcast(event);
306
+ const serverAdapter = new RedisMonitoringAdapter({
307
+ subscriber,
308
+ channel: 'siglo:monitor:events',
309
+ emitter: monitor.emitter // Automatically routes incoming Redis events to monitor store & SSE
303
310
  });
304
311
  ```
305
312
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siglo/monitor",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Live workflow monitoring server, SSE/WebSocket transports, and web dashboard for Siglo",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",