[Gambas-user] SHELL or EXEC background with gb.web.gui
Benoît Minisini
g4mba5 at gmail.com
Thu Dec 24 20:29:13 CET 2020
Le 24/12/2020 à 17:58, Mayost Sharon a écrit :
> Hello
>
> (For example I did sleep but in practice I need to run a command to
> convert that it takes some time)
>
> I'm trying to run any command in the background without WAIT
>
> so:
>
> Export
>
> Public Sub WebTimer1_Timer()
>
> WebLabel1.Text = Now()
>
> End
>
> Public Sub WebButton1_Click()
>
> Dim hProcess As Process
>
> hProcess = Shell "sleep 5" As "myp"
>
> End
>
> Public Sub myp_Kill()
>
> WebLabel2.Text = "Kill"
>
> End
>
>
> I see that it continues to the next line but on the page I see that
> the time display is stopped until the end of the command.
Normally WebTimer1_Timer() should work as expected. Can you post your
project?
>
> At the end of the command he does not update what is inside the Kill
> event WebLabel2.Text = "Kill"
Alas, as I explained in the other mail, rhe server cannot trigger
anything on the client. It can only act in the response of a request
coming from the client, which is normally a GUI interaction or a
WebTimer tick.
Maybe there is two possible tricks :
1) Opening a request forever, so that at any moment the server can act
by responding to it. The problem is that request timeout can occur at
any moment. But maybe it is enough to restart the request in that case.
2) Using "WebSocket", a browser feature. But I have never used it, and
never looked at the documentation. So maybe this is not possible.
Regards,
--
Benoît Minisini
More information about the User
mailing list