Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch up on missed events/property changes when an SSE client re-connects #3087

Open
benfrancis opened this issue Apr 27, 2023 · 0 comments
Open
Labels
task w3c-compliance wot-profile W3C WoT Profile specification

Comments

@benfrancis
Copy link
Member

The HTTP SSE Profile provides a mechanism for Consumers to catch up missed events and property changes if a client re-connects after a Server-Sent Events connection drops:

If the connection between the Consumer and Web Thing drops (except as a result of the unobserve operation defined below), the Consumer MUST re-establish the connection following the steps outlined in the Server-Sent Events specification [EVENTSOURCE]. Once the connection is re-established the Web Thing SHOULD, if possible, send any missed property changes which occurred since the last change specified by the Consumer in a Last-Event-ID header.

If the connection between the Consumer and Web Thing drops (except as a result of the unsubscribeevent operation defined below), the Consumer MUST re-establish the connection following the steps outlined in the Server-Sent Events specification [EVENTSOURCE]. Once the connection is re-established the Web Thing SHOULD, if possible, send any missed events which occurred since the last event specified by the Consumer in a Last-Event-ID header.

This would require keeping a cache in memory of events and property readings and sending missed events when a connection is re-established.

There would need to be an upper limit on the number of values stored.

@benfrancis benfrancis added task w3c-compliance wot-profile W3C WoT Profile specification labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task w3c-compliance wot-profile W3C WoT Profile specification
Projects
None yet
Development

No branches or pull requests

1 participant