view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeBarCodeCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeCellsCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# @return AccessTokenResponse
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeDiagramCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
sub o_auth_post {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeEmailCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeImagingCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeOcrCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposePdfCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeStorageCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeTasksCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeThreeDCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AsposeWordsCloud/ApiClient.pm view on Meta::CPAN
# @param integer $seconds Number of seconds before timing out [set to 0 for no timeout]
#
sub set_timeout {
my ($self, $seconds) = @_;
if (!looks_like_number($seconds)) {
croak('Timeout variable must be numeric.');
}
$self->{http_timeout} = $seconds;
}
# make the HTTP request
view all matches for this distribution
view release on metacpan or search on metacpan
examples/cmd_server.pl view on Meta::CPAN
#Connect to asterisk
my $astman = Asterisk::AMI->new(PeerAddr => '127.0.0.1',
Username => 'test',
Secret => 'supersecret',
Timeout => 3, #Default timeout for all operations, 3 seconds
Keepalive => 60, #Send a keepalive every minute
on_error => sub { print "Error occured on socket\r\n"; exit; },
on_timeout => sub { print "Connection to asterisk timed out\r\n"; exit; },
Blocking => 0
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Asterisk/CoroManager.pm view on Meta::CPAN
my $resp = $astman->sendcommand({
Action => 'QueuePause',
Interface => 'SIP/1234',
Paused => 'true',
},
{ Timeout => 2 });
Sends a command to asterisk.
If you are looking for a response, the command will wait for the
specific response from asterisk (identified with an ActionID).
Otherwise it returns immediately.
TODO: Implement timeout: Timeout is how long to wait for the response.
Defaults to 3 seconds.
Returns a hash or hash-ref on success (depending on wantarray), undef
on timeout.
lib/Asterisk/CoroManager.pm view on Meta::CPAN
if (defined wantarray) {
$astman->debug("Waiting for response of command here.");
$astman->trace(longmess());
$astman->trace("-------------------------------------");
$args ||= {};
my $timeout = $args->{Timeout} || DEFAULT_TIMEOUT;
my $response = new Coro::Channel;
$astman->{action_cb}{$actionid} = sub{ $response->put(@_) };
my $resp = $response->get; # Cede's until a response is gotten
return unless( $resp );
return wantarray ? %{$resp} : $resp;
# TODO: Timeout!
}
return;
}
lib/Asterisk/CoroManager.pm view on Meta::CPAN
sub connected {
my ($astman, $timeout) = @_;
return ($astman->{fh}->connected and
$astman->sendcommand({ Action => 'Ping' },
{ Timeout => $timeout || DEFAULT_TIMEOUT })
);
}
##############################################################################
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Asterisk/config/syntax/highlight.pm view on Meta::CPAN
return;
}
sub commands {
return qw/
AbsoluteTimeout
AddQueueMember
ADSIProg
AgentCallbackLogin
AgentLogin
AgentMonitorOutgoing
lib/Asterisk/config/syntax/highlight.pm view on Meta::CPAN
DBQuery
DBRewrite
DeadAGI
Dial
Dictate
DigitTimeout
Directory
DISA
DTMFToText
DUNDiLookup
EAGI
lib/Asterisk/config/syntax/highlight.pm view on Meta::CPAN
ReadFile
RealTime
Record
RemoveQueueMember
ResetCDR
ResponseTimeout
RetryDial
Return
Ringing
Rpt
SayAlpha
view all matches for this distribution
view release on metacpan or search on metacpan
t/useragent.t view on Meta::CPAN
$ua->connect_timeout(1);
my $search = Astro::ADS::Search->new( q => 'dark energy', sort => 'citation_count desc', rows => 100, ua => $ua);
$search->fl('ack,aff,aff_id,alternate_bibcode,alternate_title,arxiv_class,author,author_count,author_norm,bibcode,bibgroup,bibstem,citation,citation_count,cite_read_boost,classic_factor,comment,copyright,data,database,date,doctype,doi,eid,ent...
my $result = $search->query();
$DB::single = 1;
like $result->error, qr/Timeout/;
};
=cut
done_testing();
view all matches for this distribution
view release on metacpan or search on metacpan
# grab the argument list
my %args = @_;
# Loop over the allowed keys and modify the default query options
for my $key (qw / RA Dec Target Equinox Xsize Ysize Survey Format
URL Timeout Proxy / ) {
my $method = lc($key);
$self->$method( $args{$key} ) if exists $args{$key};
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
=over 4
=item *
B<Timeout handling>
By default a script will die upon timeout, this can be modified in anyway you like to keep the script going and handle the exception cleanly, an example of a handler is:
my $timed_out = 0;
$iraf->exec(command => 'print "hello"',
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
Query/Query.pm view on Meta::CPAN
Units => $radius_units,
Frame => $coord_frame,
Epoch => $coord_epoch,
Equinox => $coord_equinox,
Proxy => $proxy,
Timeout => $timeout,
URL => $alternative_url );
my $results = $query->querydb();
$other = new Astro::SIMBAD::Query( Target => $object );
Query/Query.pm view on Meta::CPAN
Units => $radius_units,
Frame => $coord_frame,
Epoch => $coord_epoch,
Equinox => $coord_equinox,
Proxy => $proxy,
Timeout => $timeout,
URL => $alternative_url );
returns a reference to an SIMBAD query object.
=cut
Query/Query.pm view on Meta::CPAN
# Loop over the allowed keys and modify the default query options, note
# that due to the order these are called in supplying both and RA and Dec
# and an object Identifier (e.g. HT Cas) will cause the query to default
# to using the identifier rather than the supplied co-ordinates.
for my $key (qw / RA Dec Target Error Units Frame Epoch Equinox
Proxy Timeout URL / ) {
my $method = lc($key);
$self->$method( $args{$key} ) if exists $args{$key};
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Astro/SkyX.pm view on Meta::CPAN
PeerAddr => $destinationIP,
PeerPort => $destinationPort,
Blocking => 0,
autoflush => 1,
Proto => 'tcp',
Timeout => "300",
);
if ( ! Scalar::Util::openhandle($SkyXConnection ) ){
die "Unable to connect to The Sky X\n";
}
$SkyXConnection->autoflush(1);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Fetch.pm view on Meta::CPAN
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
view all matches for this distribution
view release on metacpan or search on metacpan
local ( $., $@, $!, $^E, $? );
kill 9, $pid; # I don't care.
waitpid $pid, 0;
}
package AsyncTimeout;
our $VERSION = '0.14';
our @ISA = 'Async';
sub new {
C<result()> takes an optional parameter, C<$force>. If C<$force> is
true, then the calling process will wait until the asynchronous
computation is complete before returning.
=head2 C<AsyncTimeout>
use Async;
$proc = AsyncTimeout->new( sub { ... }, $timeout, $special );
C<AsyncTimeout> implements a version of C<Async> that has an
automatic timeout. If the asynchronous computation does not complete
before C<$timeout> seconds have elapsed, it is forcibly terminated and
returns a special value C<$special>. The default special value is the
string "Timed out\n".
All the other methods for C<AsyncTimeout> are exactly the same as for
C<Async>.
=head2 C<AsyncData>
use Async;
view all matches for this distribution