Hi,

I have a network equipment which is similar to the Cisco L3 switch. I use 
mojo to setup a web server on a Linux PC. The browser can send some CLI 
commands via websocket to web server. The web server can run these commands 
on network equipment and send all the results back to the browser via 
websocket. It works. But, It need to take some time to wait for all results 
done. In this case, if I have many CLI commands, it will take a long time 
to wait all results done. I want to send the result back to the browser if 
one command is executed without waiting for the other commands executing. 
Is there any way to do it via websocket?



websocket "/runcmd" => sub {

    $c->shift;

    ...

    $c->on(message => sub {
         my ($c, @commands) = @_;

         foreach ( @commands) {

              # back-end to run commands via ssh/telnet session
              my $ret = backend( $_);

              $c->send( encode_json { result => $ret});
         }

    });
   
    ...
}

Thanks,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to