Handling Background Jobs

Hello, I would like to manage background jobs using bull queues. The plan is to make a Server Connect extension (like @mebeingken did here) to add new jobs to the queue for longer server actions. The issue is processing the queue automatically.

My initial idea was to use the scheduler on a set interval to check and process the jobs from the queue, however, that might be a bit slow and the best practice recommendation is to run it in a separate background worker process as a persistent script that is always running.

My question, before I create a separate nodeJS worker script outside of Wappler to handle this. Is there a way to handle this all within Wappler (e.g by having a worker server action automatically run when the server starts without user interaction).

Agreed, it would be nice to have functionality to run actions on server start.

If it helps at all, I worked around this by doing a check when submitting the job…if the queue has not been created, then do all the queue setup work. Not ideal, but also not a huge performance issue.

2 Likes

Ohh I see, I’ll use your approach for now. Thanks for the recommendation!