Dan
Windmill Apps: frontend script helpers : recompute a backend script and wait for new job id
Thank you, @fjørdlek. This really gets in the way of asynchronous logic. Why not just natively exposing the job id in to the frontend js, as done with states?
22 replies
Windmill Apps: frontend script helpers : recompute a backend script and wait for new job id
Thank you, @fjørdlek , this works for me as well.
From my frontend code, I want to be able to call an execution of backend runnable, and wait for the result. Does that make sense?
22 replies
Windmill Apps: frontend script helpers : recompute a backend script and wait for new job id
Hi Alex, thank you!
See the script below. This is a frontend js in App:
let job1 = ""
let job2 = ""
async function runAndWait() {
await new Promise(resolve => setTimeout(resolve, 2000))
job1 = bg_0.jobId
await new Promise(resolve => setTimeout(resolve, 2000))
await recompute("bg_0")
await new Promise(resolve => setTimeout(resolve, 2000))
job2 = bg_0.jobId
}
await runAndWait()
return {job1, job2}
22 replies