in Education by
I need to write a server program that will open and keep 5 live Telnet, SSH and various connections to a server, while it listens to JSONRPC calls on the other side. I've no problem with opening and maintaining the 5 connections, and listening for requests: # workers: open_myconnections( 1..5 ); my $w1 = AnyEvent->timer (interval => $seconds, cb => sub { keep_conn_alive(1) }); my $w2 = AnyEvent->timer (interval => $seconds, cb => sub { keep_conn_alive(2) }); ... # now listen for requests use AnyEvent::JSONRPC::Lite; # master: my $server = jsonrpc_server '127.0.0.1', '4423'; $server->reg_cb( queue_up => sub { my ($res_cv, @params) = @_; my $res = send_params_to_connection_queue( @params ); $res_cv->result($res); }, ); But now I'm stuck trying to figure out the best way (ie the non-blocking, AnyEvent way) to distribute the queue among the 5 workers, which is what my function send_params_to_connection_queue() does. Any module suggestion is appreciated, although I'm trying to avoid using POE since this is supposed to be a very tiny server and, unless no other sensible option exists, I'll pass. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
At YAPC::NA 2011 I learned about a very nice queueing system called ZeroMQ. With Perl Bindings at Direct Perl Bindings and AnyEvent bindings. |----- ssh worker JSONRPC-Listener-EventLoop---->QueueingSystem---|----- telnet worker |----- etc.

Related questions

0 votes
    I have a website which has a service worker like: // Import a script from another domain importScripts(' ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    My CPU usage is 100% most of the the time in Windows Server 2008-R2 with my own vps, vmware, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    My good ladies and gentlemen, I recently had my first go at Worker services in .Net Core 3.1, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    My scenario is this: I've got worker which enqueues tasks into a multiprocessing.Queue() if said is empty. This is to ... which pop from the mp.Queue and do some stuff. Sometimes (...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which will be invoked to create a new worker? (a) Function (b) Destructor (c) Constructor (d) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which of the following is a global object for a new worker? (a) WorkerGlobalScope (b) Worker (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    How can you send data using a Worker object? (a) postMessage() (b) sendMessage() (c) Message() ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of the following element allows you to create and manage virtual machines that serve either in a Web role and a ... Compute 2) Application 3) Storage 4) None of the mentioned...
asked Dec 23, 2020 by JackTerrance
+1 vote
    Which of the following services allow creation and management of virtual machines that serve either in a Web role and a Worker role?...
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    Create a new Pull request. Review the changes between master and starfeature branch, and confirm by clicking Create ... . Stakeholders C. Starprojectteam D. None of the options...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    Which of the following creates new commit when you pull new changes from master to the feature branch? A. git rebase master B. git merge master C. git pull origin master...
asked Dec 20, 2022 in Technology by JackTerrance
0 votes
    State the appropriate concept for the given statement. The aspect of liberty is expressed by Berlin’s statement “I am my own master”. Please answer the above question....
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    When using a UISplitViewController in portrait mode on an iPad I am given a fullscreen view of my detail ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
...