Skip to content

Question: How to subscribe client to different channels on demand #19

@JavoByte

Description

@JavoByte

Hi

I have a problem and I don't exactly know how to solve it. Currently, I'm using this library to subscribe clients to specific events. However, in my case, a client can subscribe to multiple events. So, I have to open an EventSource per event source.

My question is, could it be possible to have only one EventSource and in my node server have a route like
events/:eventID/subscribe
which, assuming the client has already opened an EventSource and a SseChannel for the eventID exists, add the client to the SseChannel so the next message sent to the channel is received by the client?

The response content type of this url should be application/json just saying something like "Ok, you'll receive updates in your EventSource" and may be, trigger a message in the EventSource.

How would you solve this or attack this problem? I'm a clueless here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions