AnyEvent is fairly portable
Really? Does it work with files and pipes under Windows?
Does AnyEvent::DBI work on Windows? Cos you certainly wouldn't think so looking at the source:
my $pid = fork;
if ($pid) {
# parent
close $server;
} elsif (defined $pid) {
# child
my $serv_fno = fileno $server;
if ($self->{exec_server}) {
fcntl $server, &Fcntl::F_SETFD, 0; # don't close the server s
+ide
exec {$^X}
"$0 dbi slave",
-e => "require shift; AnyEvent::DBI::serve_fd ($serv_fno
+, $VERSION)",
$INC{"AnyEvent/DBI.pm"};
POSIX::_exit 124;
} else {
($_ != $serv_fno) && POSIX::close $_
for $^F+1..$FD_MAX;
serve_fh $server, $VERSION;
# no other way on the broken windows platform, even this leak
+s
# memory and might fail.
kill 9, $$
if AnyEvent::WIN32;
# and this kills the parent process on windows
POSIX::_exit 0;
}
} else {
croak "fork: $!";
}
$self->{child_pid} = $pid;
$self->_req (
($self->{on_connect} ? $self->{on_connect} : sub { }),
(caller)[1,2],
req_open => $dbi, $user, $pass, %dbi_args
);
$self
}
has a solution to blocking APIs like DBI. ... it spawns an external process which executes the fetch and then passes the results back via IPC.
I guess I could have said "don't have a good solution", but I don't consider starting a new process for each query and then having to squeeze potentially large amounts of structured data through a byte stream, a solution worthy of the name.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
-
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.