trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

feat: Websocket support for status APIs

Open krzkaczor opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

I am surprised that old-school HTTP pooling is used in react package instead of something like websockets.

Describe the solution you'd like to see

Websockets could provide faster updates (but ofc there is some architecture overhead). Is this something that is on your roadmap?

Describe alternate solutions

Additional information

No response

krzkaczor avatar Jan 07 '24 10:01 krzkaczor

Yep we’ve talked about adding web socket and Server Sent Event support. We’d use Redis PubSub to make it easier to build I think.

@krzkaczor out of interest, which of the hooks are you using/thinking of using? We have a few different ones and I’m interested in figuring out the most valuable.

matt-aitken avatar Jan 07 '24 11:01 matt-aitken

I want to be able to track the progress of a job so I added a custom status to the job as defined in docs. On the client side, I use useEventRunStatuses hook (inside next.js app).

For now, it's nothing more than a PoC but I am absolutely loving trigger.dev so far. I can't wait to build something production-ready with it ;)

krzkaczor avatar Jan 07 '24 11:01 krzkaczor

Thanks!

I'm glad you said the Status hooks because we're going to be taking that system and turning it into a more powerful notification system. React hooks, web sockets, SSE etc will be possible ways to subscribe to it.

matt-aitken avatar Jan 08 '24 12:01 matt-aitken