-
Notifications
You must be signed in to change notification settings - Fork 0
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
Consider a property implementation using SSE as notification mechanism #2
Comments
Fully agree :) just a comment about naming, maybe expressing the subscription using url is a bit more generic. In the sense that singular+plural may not be possible to be used in all cases and the property developer must specify then 2 names (not feasible to guess). If we agree on something like Just a question out of curiosity, what prevents us to use just 1 endpoint with a different content type like |
Concerning the different content types on the same endpoint: I do not know. Would have to be checked... I do not know how exactly the final content type is negotiated between server and client. One advantage of haveing two different endpoints is that the server deifnes the content type and when pointing a browser to it, it delivers the right thing. If we go to the path like structure, indeed then one could have something like you propose:
I assume this is the most webish way.... However, thinking a bit further on different properties we might have:
taking this into account, one could make it a bit more explicit which operations the property is capable of ...
The capability would be defined by the fact that the corresponding enpoint is available... |
I think we basically have two options
For (1), in principle one could possibly join SSE and GET/POST on one endpoint by means of content negotiation (Accept-Header). However, This is rather brittle and intermediate Proxies might break it, so I'd rather not go for that. In this case I would rather use 2 endpoints ("value" and "stream" looks OK to me). GET/SET would be distinguished by the allowed HTTP methods on value. You can define an endpoint which only allows e.g. POST to value but not GET, which would be a write-only property. On the other hand, you could only allow GET for a read-only property. Using another method should (by protocol) trigger a "405 Method Not Allowed" type error. |
Probably for this use-case, SSE are slightly more suited then websocket I'm starting to think..
this would allow in the future to add some more endpoints. You could even do a What do you think? |
Ok ... Andrea, what misfeelings do you have about the stream? Could e.g.
or
(as we said we might update only on change) .. or even
be an option? (I think here the plural would be ok, as it always works) or
(I do not like the camelCase too much ....) just ideas... |
... and indeed, I like the extensibility |
Using SSE as notification would bring:
Still we need 2 endpoints (one for get/set, one for the SSEs).
A proposal for endpoint naming:
The text was updated successfully, but these errors were encountered: