Coro-Mysql

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Perl extension Coro::Mysql

2.1  Mon Mar  4 12:40:34 CET 2019
	- first attempt at supporting DBD::MariaDB.
        - new Coro::Mysql::is_unblocked function.
        - new Coro::Mysql::have_ev function.
	- updated docs to remove violite scare and add newest history.

2.0  Mon Mar  4 06:15:03 CET 2019
        - major port to new MARIADB_PVIO structure (Pluggable Virtual
          IO) - so, yay, finally no more header file hacking because an
          official API exists, but since it is new, the PVIO api is quite
          broken, and due to the massive changes involved, not sure about
          backwards compatibility or stability. Seems to work for me.
	- use mariadb_config or mysql_config commands to find includes

Mysql.pm  view on Meta::CPAN

            $fh = Coro::Handle::unblock ($fh);
         }

         _patch $sock, $sockfd, $cvers, $fh, tied *$$fh;
      }
   }

   $DBH
}

=item $bool = Coro::Mysql::is_unblocked $DBH

Returns true iff the database handle was successfully patched for
non-blocking operations.

=cut

sub is_unblocked {
   my ($DBH) = @_;

   if ($DBH) {
      my $mariadb = $DBH->{Driver}{Name} eq "MariaDB";
      if ($mariadb or $DBH->{Driver}{Name} eq "mysql") {
         my $sock = $mariadb ? $DBH->{mariadb_sock} : $DBH->{sock};
         return _is_patched $sock
      }
   }

README  view on Meta::CPAN

        about any value), but it will only do anything to DBD::mysql
        handles, others are returned unchanged. That means it is harmless
        when applied to database handles of other databases.

        It is also safe to pass "undef", so code like this is works as
        expected:

           my $dbh = DBI->connect ($database, $user, $pass)->Coro::Mysql::unblock
              or die $DBI::errstr;

    $bool = Coro::Mysql::is_unblocked $DBH
        Returns true iff the database handle was successfully patched for
        non-blocking operations.

    $bool = Coro::Mysql::have_ev
        Returns true if this Coro::Mysql installation is compiled with
        special support for EV or not.

        Even if compiled in, it will only be used if EV is actually the
        AnyEvent event backend.



( run in 0.294 second using v1.01-cache-2.11-cpan-26ccb49234f )