AnyEvent-DBI

 view release on metacpan or  search on metacpan

DBI.pm  view on Meta::CPAN


   $fork->require ("AnyEvent::DBI::Slave");
   $fork->send_arg ($VERSION);
   $fork->send_fh ($server);

   # we don't rely on the callback, because we use our own
   # socketpair, for better or worse.
   $fork->run ("AnyEvent::DBI::Slave::serve", sub { });

   {
      Convert::Scalar::weaken (my $self = $self);

      my $cbor = new CBOR::XS;

      $self->{rw} = AE::io $client, 0, sub {
         my $len = Convert::Scalar::extend_read $client, $rbuf, 65536;

         if ($len > 0) {
            # we received data, so reset the timer
            $self->{last_activity} = AE::now;

DBI.pm  view on Meta::CPAN


If an error occurs and the C<on_error> callback returns, then only C<$dbh>
will be passed and C<$@> contains the error message.

=item $dbh->exec ("statement", @args, $cb->($dbh, \@rows, $rv))

Executes the given SQL statement with placeholders replaced by
C<@args>. The statement will be prepared and cached on the server side, so
using placeholders is extremely important.

The callback will be called with a weakened AnyEvent::DBI object as the
first argument and the result of C<fetchall_arrayref> as (or C<undef>
if the statement wasn't a select statement) as the second argument.

Third argument is the return value from the C<< DBI->execute >> method
call.

If an error occurs and the C<on_error> callback returns, then only C<$dbh>
will be passed and C<$@> contains the error message.

=item $dbh->stattr ($attr_name, $cb->($dbh, $value))

README  view on Meta::CPAN

        value if successful.

        If an error occurs and the "on_error" callback returns, then only
        $dbh will be passed and $@ contains the error message.

    $dbh->exec ("statement", @args, $cb->($dbh, \@rows, $rv))
        Executes the given SQL statement with placeholders replaced by
        @args. The statement will be prepared and cached on the server side,
        so using placeholders is extremely important.

        The callback will be called with a weakened AnyEvent::DBI object as
        the first argument and the result of "fetchall_arrayref" as (or
        "undef" if the statement wasn't a select statement) as the second
        argument.

        Third argument is the return value from the "DBI->execute" method
        call.

        If an error occurs and the "on_error" callback returns, then only
        $dbh will be passed and $@ contains the error message.



( run in 0.250 second using v1.01-cache-2.11-cpan-65fba6d93b7 )