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.
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.