There is a large class of different use cases where we want to efficiently communicate between the server and a browser. There is a hodge podge of very inefficient polling code scattered in different places in core and 3rd party plugins.
Ages ago I deep dived into this and started working on a spec for this but it's gathered dust since. This doc may be slightly out of date in the details but conceptually should be broadly ok as a rough starting point:
Anyone can view and comment on that google doc