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

Forward events through a websocket #15

Open
5 tasks
thclark opened this issue May 31, 2022 · 0 comments
Open
5 tasks

Forward events through a websocket #15

thclark opened this issue May 31, 2022 · 0 comments
Assignees
Labels
backend Related to the back end feature A new feature of the app performance If you want to run cool, you've got to run on heavy, heavy fuel

Comments

@thclark
Copy link
Contributor

thclark commented May 31, 2022

Feature request

Use Case

We often need to consume events created by services in a frontend, which means that upon receipt in django they must be emitted through a websocket endpoint.

We may also need to view the event stream at a later date (e.g. long after the question has been asked and the channels cache has been flushed.

Proposed Solution

  • Create a 'chatroom' consumer for a given question
  • Authenticate connections to it using a token (available on the question model so we can pass the token to those we want to view the stream)
  • On receipt of an event, emit it forward to connected clients
  • On connection after the start of the question stream, all events since the start of the question should be flushed through to the newly connected client
  • In the event of stale connections (i.e. connections made much later after the channel cache in REDIS is cleared) we'll need to re-flush events through the consumer (using the database as a source, instead of the original event stream) so clients always receive the full event stream.
@thclark thclark added backend Related to the back end feature A new feature of the app performance If you want to run cool, you've got to run on heavy, heavy fuel labels May 31, 2022
@thclark thclark moved this to Priority 3 (High) in Octue Board May 31, 2022
@thclark thclark assigned thclark and unassigned cortadocodes Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the back end feature A new feature of the app performance If you want to run cool, you've got to run on heavy, heavy fuel
Projects
Status: Priority 3 (High)
Development

No branches or pull requests

2 participants