Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

*Grins widely* ...

Why you ask would I design it this way? Because I'm planning something evil: IE6 support. And here's the convoluted setup which I wanted to just keep segmented for simplicity's sake, but here we go:

I have a catalyst web app serving a number of people. The app polls the server using jQuery XMLHTTP (AJAX) every N seconds (usually 2) with a task ID. I have scrolling text panes to show the output of the tasks.

The problem which I must solve is how to get this streaming data from remote server C, while catalyst server B answers AJAX requests from client A. It's a polling system, where the browser sends a request to the catalyst server which then contacts the listening service for either initiation of long running SSH commands, or for content updates

WEBSOCKETS WOULD BE BETTER, but I'm supporting IE6 and 7 here. And I also can't have users in browsers hitting the more private daemon that's doing the remote SSH commands. In this situation, the catalyst app acts as a firewall for it and only sends "trusted" commands based on sanitized user input.

Now to clarify one thing I may have miscommunicated: each client connection does NOT go to the master thread. The sole responsibility of the master thread is to enforce timeouts on running tasks. "Listener" threads will be responsible for taking connections, looking up the running tasks in a shared hashref, opening the queue for task ID foo, spewing the update via ->dequeue() to the client, and hanging up. Then catalyst sends the updated data back to the web client in a well-formed AJAX response which gets populated into the scrolling faux terminal windows in the browser.

The idea is that the browser window is divided into panes which form a dashboard. Each pane scrolls different server health/activity statistics (IO/CPU/Network/Memory). Above all that will be a moving line graph using google charts or the like. It's a grand scheme, but the hard part is the back end plumbing that I'm trying to create. The front-end stuff is easy.

Tommy
A mistake can be valuable or costly, depending on how faithfully you pursue correction

In reply to Re^2: Help designing a threaded service by Tommy
in thread Help designing a threaded service by Tommy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-20 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found