AnyEvent-Redis
view release on metacpan or search on metacpan
inc/Module/Install/Can.pm view on Meta::CPAN
# No working C compiler
return 0;
}
# Write a C file representative of what XS becomes
require File::Temp;
my ( $FH, $tmpfile ) = File::Temp::tempfile(
"compilexs-XXXXX",
SUFFIX => '.c',
);
binmode $FH;
print $FH <<'END_C';
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main(int argc, char **argv) {
return 0;
}
int boot_sanexs() {
lib/AnyEvent/Redis.pm view on Meta::CPAN
$self->{sock} = tcp_connect $self->{host}, $self->{port}, sub {
my $fh = shift
or do {
my $err = "Can't connect Redis server: $!";
$self->cleanup($err);
eval { $cv->croak($err) };
warn "Exception in connect failure callback (ignored): $@" if $@;
return
};
binmode $fh; # ensure bytes until we decode
my $hd = AnyEvent::Handle->new(
fh => $fh,
on_error => sub { $_[0]->destroy;
$self->cleanup($_[2]) if $_[1];
},
on_eof => sub { $_[0]->destroy;
$self->cleanup('connection closed');
},
encoding => $self->{encoding},
( run in 0.248 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )