import { Controller, Sse, Headers } from '@nestjs/common';
import { interval, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
interface FeedPayload {
id: number;
import { Response } from 'express';
type Client = { id: number; res: Response };
const clients = new Map<string, Set<Client>>();
let nextId = 1;
const { EventEmitter } = require('events');
class NotificationBus extends EventEmitter {
constructor(bufferSize = 100) {
super();
this.setMaxListeners(0);
require 'set'
require 'json'
class Broadcaster
def initialize
@mutex = Mutex.new