Global Feed Post Login
Replying to Avatar ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ

what is difficult about subscriptions is the logic defining when one opens, and when it doesn't, and when it closes

these are defined mainly through the use of the limit. once the number of results exceeds the limit, the subscription is complete. if you don't set a limit, the subscription should remain open until you send a CLOSE

in my opinion, a dedicated endpoint you send a filter to, that ignores the limit, just opens a subscription and this is sent via the SSE channel the client has opened beforehand to receive it, and then you have a "close" endpoint that accepts the subscription identifier.

this also does mean that a subscription data format for SSE needs to be basically the same as an EVENT result, except you don't need to have EVENT prefix sentinel, it can just be "subscription",

Avatar
ᴛʜᴇ ᴅᴇᴀᴛʜ ᴏꜰ ᴍʟᴇᴋᴜ 5mo ago

i think that SSE standard formatting includes a subscription identifier field also, it can be on a separate line

Reply to this note

Please Login to reply.

Discussion

No replies yet.