An archive of community.esquilo.io as of Saturday January 26, 2019.

Erpc blocking when accessing via esquilo.io

robertjensen

I have a nut that defines some functions. If I visit a web page with the IP address on my LAN, I can use an erpc call to execute the "run" function with a short timeout and then use another erpc call to stop the execution. I can also make a erpc call that checks the status of the "run" function execution while it is still executing.

When I visit this same web page via esquilo.io, once the "run" function is executed, other erpc calls seem to be blocked until the "run" function is complete.

Why is there a difference? Is there a way to accomplish the same kind of behavior that I get locally by way of esquilo.io?

function run(cnt){
countdown = cnt
while(countdown>0){
--do_some_stuff--
countdown -= 1;
}
}
function stoprun(){
countdown = 1;
}
function count(){
return countdown;
}

robertjensen

I can answer the second of my own questions. (Sorry for not working a bit more on this before asking my questions.) I found that I can do what I want to do by using the esquilo timer class. The run function doesn't block other executions this way. I still don't know why things act differently between the two methods of access (local LAN and esquilo.io).

loopTimer <- Timer(runloop);

function run(cnt)
{
    countdown = cnt;
    loopTimer.start(100);
}
function runloop(){
    while(countdown>0){
    ...