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

Server sent events #43

Open
olanod opened this issue Apr 19, 2021 · 0 comments
Open

Server sent events #43

olanod opened this issue Apr 19, 2021 · 0 comments
Milestone

Comments

@olanod
Copy link
Member

olanod commented Apr 19, 2021

Clients of a Valor API will be HTTP-only initially as it is the only protocol interceptable in Service Workers. To provide an event subscription mechanism there is luckily SSE that works on top of plain HTTP unlike WebSockets that follows a different protocol upgrade and is not interceptable from the SW.
From the plugin implementation side it could be that if the return type of the on_request handler is a Stream then we assume the protocol used is SSE. Other option is for the plugin to block and loop indefinitely publishing messages via the Context object and the runtime decides what to do with the events, like send it to other plugins that are subscribed or a special plugin that handles all the SSE requests.

@olanod olanod added this to the v1.0 milestone May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant