NAME

DBIx::Loop::Loop::Mojo - drive DBIx::Loop on Mojo::IOLoop

SYNOPSIS

use DBIx::Loop;
use DBIx::Loop::Loop::Mojo;

my $adapter = DBIx::Loop::Loop::Mojo->new;   # or (loop => $io_loop)
my $db = DBIx::Loop->connect($dsn, $u, $p, \%attr, loop => $adapter);

# future style
my $f = $db->query("SELECT ...");
$adapter->await($f);

# promise style
$adapter->to_native($db->query("SELECT ..."))->then(sub { ... })->wait;

DESCRIPTION

The loop adapter for Mojo::IOLoop. Implements the DBIx::Loop loop seam over the Mojo reactor; to_native bridges a query future to a Mojo::Promise for promise-style chaining. See DBIx::Loop.

AUTHOR

LNATION <email@lnation.org>