Skip to content
Discussion options

You must be logged in to vote

Hello, @giovio

For what you've described I'd also suggest to consider a bit simpler SSE approach that is available in Express Zod API:
https://ez.robintail.cz/v28.7.5/subscriptions
Doing that, you'd only have to maintain the "room" of those to notify.

Regarding your questions:

Is capturing onStartup's context the intended pattern for "emit from elsewhere in the app", or is there a blessed API I've missed?

It was not supposed to "emit elsewhere in your app". For the cases like this, the idea was to keep the emission inside the onStartup hook while also interacting with other parts of the application via an EventEmitter or similar. Your Express Zod API endpoint could emit an internal even…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants