-
Hello folks! Thank you for the fantastic library. I am excited about the upcoming features! I have a question regarding job scheduling within a worker. Specifically, I am looking to insert jobs to be executed from within a worker. For instance, imagine a scenario where a primary job performs substantial processing but reaches a point where it needs to initiate another job, either scheduled or triggered immediately. I reviewed the API but couldn't find a solution for this requirement. Is it currently possible to achieve this functionality? If not, could this be considered for a future feature? I understand it may be complex due to the river client requiring worker setup for initialization. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @javirln, check out docs on getting a client from worker context: https://riverqueue.com/docs/context-client Another way to do this is to take your initialized client and make it available to all your workers through something like a shared, embedded struct. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much @brandur! |
Beta Was this translation helpful? Give feedback.
Hi @javirln, check out docs on getting a client from worker context:
https://riverqueue.com/docs/context-client
Another way to do this is to take your initialized client and make it available to all your workers through something like a shared, embedded struct.