Skip to content

WIP: Add support for socket.io to enable websockets

Kamil Trzciński requested to merge socketio-with-async-refresh into master

Use socket.io and websockets to add a minimal change to support live-refresh of data (currently long-polled) over web sockets, using the same API and explicitly registering from client to subscribe to data

This is proof of concept, the experiment that does work and uses the current API, ETag caching, and expire of endpoints to have single multiplexed connection over web sockets to deliver updates "immediately". It tries to use everything that we have now and make the compatible change with how we update data. @lbennett is doing a sprint for making a needed frontend change.

This makes a browser to open a single WebSocket connection for all real-time updates and subscribe over that connection.

This re-uses what we use for long-polling for CI runners, but moves that slightly to next level. Rails can generate a notification about resource invalidation, Workhorse does catch that and notifies every watching client about with a new resource data.

This is Proof of Concept, done as quickly as possible (it took me about 3h to have that working).

I did not evaluate possible solutions, it is just for PoC purposes. Iterate fast to see how quickly I can get something working with @lbennett's help.

Make GitLab send notifications about changes: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11575

cc @lbennett @jschatz1 @stanhu @andrewn

Edited by Wayne Haber

Merge request reports