Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: A question of fork efficiency

by synless (Acolyte)
on Aug 05, 2019 at 19:45 UTC ( [id://11103987]=note: print w/replies, xml ) Need Help??


in reply to Re: A question of fork efficiency
in thread A question of fork efficiency

You are correct in assuming the while statement is to force output order. This part of the function was taken from the function that actually runs commands on the remote servers. When multiple lines of output are returned simultaneously we want the output to be grouped together instead of intertwined.

I've never used event-based sockets for anything as I'm still relatively new to the programming in general. Any suggestions on where to get started would be appreciated.

I should clarify the CPAN modules statement. Generally I can use anything from CPAN that is already prepackaged in an rpm for CENTOS7/RHEL7 and is in their default repositories. I can also grab modules that can be easily packaged using cpanspec. This tool is to be used internally by teams I support and other teams. Corporate policy forbids quite a few of these teams from having CPAN access so I'm limiting what I can use based on that. If it is a module with very little dependencies I'll consider it. Thanks for your input so far!

Replies are listed 'Best First'.
Re^3: A question of fork efficiency
by Tanktalus (Canon) on Aug 05, 2019 at 21:25 UTC

    Generally speaking, I would print out the return values as I received them, but then, at the end, print out a nice pretty, ordered list. This allows for systems that respond quickly to show up quickly, and systems with lag responding to not delay the quick ones, at least during the running.

    Where to get started - that is a matter of preference. I had someone here recommend AnyEvent and Coro to me ages ago, and that's what I'm using for the CB stats and last hour of cb updates (it's all in a single process and a single thread, making http calls to Perlmonks, both for downloading and uploading, and updating databases, and actually having a built-in chatterbox client as well). There's a pretty good chance that Coro won't be available in an RPM on RHEL/CentOS. However, Yes, even you can use CPAN might still be worth a read for your situation.

      Thanks! I'll check those out soon. If they don't have too many other dependencies I can probably get cpanspec to build them. Though so far it is choking on common::sense so we'll see on that one. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11103987]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-25 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found