Skip to content

[Feature]: Server sent events #177

@jhodapp

Description

@jhodapp

Suggestion / Feature Request

We have several use cases where we want to be able to send an event to one or more specific frontend clients purely initiated by the backend. For example, to update some other entity on a coaching session page when another user in the session changes it (e.g. adds or updates an Action or Agreement).

This needs some thought about what our requirements are, which will then dictate the approach we take, whether it's Server Sent Events (SSEs) or Webhooks or some other subscriber mechanism that each client could subscribe to to receive events over.

Use Cases & Requirements:

  1. Think about if this needs an external system like Inngest, or if we can self-host an eventing mechanism and/or system (in-process inside refactor_platform_rs main process using threads, out-of-process so it can be independent?)
  2. It'd be great to be able to run backend async jobs with such a system
  3. Clients should be able to subscribe to a 1:1 or 1:many relationship with the backend to be aware of to take action on it (e.g. Coach adds a new Action and the Coachee wants to see this without refreshing their Coaching Session page)
  4. We should be able to broadcast a non-stateful message to all active frontend clients, for example, "Join us for a webinar to learn more about X"
  5. We should be able to broadcast a non-stateful message to all active frontend clients that are part of a specific Organization, for example, "Refactor is hosting an event in Slack discussing software architecture at 3 pm on Wednesday".
  6. We should be able to send a non-stateful action to a specific front client, for example, their backend session has expired and the frontend client should immediately be redirect to the login page.
  7. We should be able to send a non-stateful action to all frontend clients, for example, we need all frontend clients to refresh to update to a specific version of the client code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproves existing functionality or feature

    Projects

    Status

    🔖 Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions