Pode.Web icon indicating copy to clipboard operation
Pode.Web copied to clipboard

update-webprogress

Open solipsist01 opened this issue 2 years ago • 4 comments

i'd like to update a webprogress bar while in a loop after clicking submit. everything gets passed along, only after the loop is finished.

i thought going around this, by passing variables to set-podestate, and use a timer with a 1s interval which reads out the variables. however, timers pause while submit and the loop is active.

did anyone, somehow, find a hack to get around this? or would this only be possible with 1.0 / websockets etc. Oh yeah, also, file stream isn't an option for me, as cloudflare tunnel removes the RANGE header.

Thank you

solipsist01 avatar Sep 16 '23 14:09 solipsist01

i think i have thought of a solution. the submit button just fills a variable with 'to process jobs' and is finished instantly. the timer does the actuall execution, and processes one job at a time, and refreshes variables, and also the progress bar, and when finished one job of multiple jobs in queue, removes the finished job. when the timer hits again, it repeats the process until it's empty. i will test this next monday and let know the results.

solipsist01 avatar Sep 17 '23 07:09 solipsist01

Hi @solipsist01,

Out of interest, do you have -Threads set on Start-PodeServer? The default number of threads is 1 when not supplied, which might explain the timers appearing to be blocked issue while the thread is being used by the submit button.

Badgerati avatar Sep 18 '23 07:09 Badgerati

Hello :)

I just tested with -Threads = 5 i just put a pause in the submit button routine so it would never continue. for me, the timers don't work during this period, also with multiple threads :)

i've developed a queue system which works around this, and i'm all happy :)

solipsist01 avatar Sep 19 '23 04:09 solipsist01

Interesting! I'll leave this issue open for now, just so I can test the behaviour myself - in case there's something I need to fix 😄

Badgerati avatar Sep 24 '23 20:09 Badgerati