logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Net::OpenSSH::ConnectionCache - cache and reuse SSH connections transparently

Description

       This module installs a $Net::OpenSSH::FACTORY hook implementing a SSH connection caching scheme.

       $Net::OpenSSH::ConnectionCache::MAX_SIZE controls the cache size. Once as many connections are allocated,
       the module will try to free any of them before allocating a new one.

       The function "clean_cache" makes the module forget (and close) all the cached connections:

         Net::OpenSSH::ConnectionCache::clean_cache();

Name

       Net::OpenSSH::ConnectionCache - cache and reuse SSH connections transparently

Synopsis

         use Net::OpenSSH;
         use Net::OpenSSH::ConnectionCache;

         for (1..10) {
           my $ssh = Net::OpenSSH->new($host);
           $ssh->system("$cmd $_");
         }

See Also