Realtime x Background Jobs (Inngest)

Hi all!

My team and I have been looking forward to getting RedwoodJS Realtime setup in our since it was released, as we strive to eventually have a “google docs” level of collaboration on the forms within our order management system.

I wanted to take an extra look at realtime today since I’m doing some work that right now is polling the backend waiting for a response. This works of course, but the ideal in my eyes would be if the server directly communicated with the client when the results were processed.

While investigating if Realtime was suitable for this application, I quickly realized that it was highly dependent upon the “context” argument passed into graphql functions. This makes sense as the server knows what client the request is coming from, and by passing the function in as an argument, the dev-ex is super easy to invalidate live queries/publish changes to subscriptions.

Unfortunately, this seems to gate keep the Realtime functionality just to the graphql layer (again, from my current understanding) Which seems to prevent any processing in the background (in our case Inngest) to have the ability to trigger realtime actions.

Inngest also seems to have a similar limitation where there’s no way to really wait for an inngest function from where it was called. It really only allows you to poll for it. Even if that wasn’t the case, we have a bit of side effects that are handled through inngest jobs and are triggered at the core in a prisma plugin that listens triggers inngest with said updates. This allows us to know that even if another prisma call is triggering x update, the changes will be persistent across the application.

Is there any existing way to publish changes to subscriptions, or live queries? If not, would there be any possibility in providing a global liveQueryStore or pubSubStore where we can trigger the real time actions, perhaps by providing some sort of organization Id if necessary for this functionality?