Open AdamWill opened 3 years ago
I don't think Mango is maintained anymore.
Ah, now I poke through a checkout, there's actually quite a lot of code and test code that use Delay
. So this module is incompatible with Mojo 9.
There is a patch in fortl's fork in commit https://github.com/fortl/mango/commit/90f13e16fd0f8053479fcf2e497672463061e7ea. It's mostly a white-space shuffle. Without it, it boils down to:
--- a/lib/Mango/Auth/SCRAM.pm
+++ b/lib/Mango/Auth/SCRAM.pm
@@ -34,11 +34,9 @@ sub _authenticate {
password => $pass
);
- my $delay = Mojo::IOLoop::Delay->new;
+ my $loop = Mojo::IOLoop->new;
my $conv_id;
- my $end = $delay->begin;
-
my $command = $self->_cmd_sasl_start($scram_client->first_msg);
$mango->_fast($id, $db, $command, sub {
my ($mango, $err, $doc) = @_;
@@ -54,12 +52,12 @@ sub _authenticate {
$mango->_fast($id, $db, $command, sub {
my ($mango, $err, $doc) = @_;
$mango->emit(connection => $id)->_next;
- $end->();
+ $loop->stop;
})
})
});
- $delay->wait;
+ $loop->start;
}
The examples in the docs include one that relies on
Mojo::IOLoop::Delay
, which has been removed from Mojolicious 9.0. Not sure if there's an alternative way to do what that example does, @kraih would know.