Describe the feature
class SourceOfEvents {
async process(id: string, emit: (event) => void) {
for (let i=0; i<100; i++) {
emit({
message: `event id=${id} count: ${i}`
});
await timeout(1000);
}
}
}
const sourceOfEvents = new SourceOfEvents();
test: os
.input(z.obiect({
id: z.string(),
}))
.handler(async ({ input, emit }) => {
await sourceOfEvents.process(input.id, emit);
//end of stream SSE
})
I would like to be able to create an SSE handler without generators.
In my application, I would like to have an object or function that allows sending new events directly to an SSE stream (without generators).
Additional information
Describe the feature
I would like to be able to create an SSE handler without generators.
In my application, I would like to have an object or function that allows sending new events directly to an SSE stream (without generators).
Additional information