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

Auto update UI #103

Open
rctneil opened this issue Mar 29, 2024 · 2 comments
Open

Auto update UI #103

rctneil opened this issue Mar 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@rctneil
Copy link

rctneil commented Mar 29, 2024

Is this going to get support for updating the page live?

@rosa
Copy link
Member

rosa commented Mar 29, 2024

Hey @rctneil, that's not on my list of priorities for now, but if someone wants to submit a PR for it, I'll be super happy to review!

@rosa rosa added the enhancement New feature or request label Dec 3, 2024
@genezys
Copy link

genezys commented Dec 4, 2024

I made some tests by adding the following to the Record abstract model in SolidQueue. Note that it is important to use the synchronous versions to prevent an infinite loop that will create broadcasting jobs when scheduling a new job for example. I did not test but it may have a limited impact on performance.

    after_create_commit -> { broadcast_refresh_to model_name.plural }
    after_update_commit -> { broadcast_refresh }
    after_destroy_commit -> { broadcast_refresh }

Then, mission_control-jobs can use those broadcasts in the views to trigger a page refresh on change.

  <%= turbo_stream_from job %>

or

  <%= turbo_stream_from :solid_queue_jobs %>

I only tested this on jobs as a proof of concept but it may be possible to monitor queues, job executions, etc.

This is just food for thought, I absolutely do not know if that would be desirable, it may degrade the execution performance or trigger too much page refresh. Another simpler solution would be to implement a regular polling refresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants