Open kumarshantanu opened 2 years ago
Is this meant to be for pushing events instead of polling? I am having an event-queue that I would like to subscribe on but currently it seems this is not possible with this middleware, right?
@TimoKramer This middleware implements https://en.wikipedia.org/wiki/Server-sent_events for server push. SSE can be done with pure HTTP without needing WebSockets - the later, however, is useful for bidirectional communication. Technically, with this middleware you can create a web-endpoint per event-queue for single consumer, or fan-out consumer endpoints per queue for multiple-consumers and consume events. For complex needs there's https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object and https://github.com/asyncapi/spec to look up.
Technically, with this middleware you can create a web-endpoint per event-queue for single consumer, or fan-out consumer endpoints per queue for multiple-consumers and consume events.
That's exactly what I need. A web-endpoint per event-queue. I thought with this lib I can only poll a fn, because I understand this issue is supposed to add this feature. Am I wrong?
@TimoKramer This issue is only to stop issuing empty messages when the queue doesn't have anything. Your use-case is already doable - you just need to wrap the endpoint handlers (must be Ring-compliant) with this middleware.
Currently, only time-delay based events are generated. This is a feature request to add support for generating events only when some content is available.