Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs refer to Mojo::IOLoop::Delay, which has been removed in 9.0 #38

Open
AdamWill opened this issue May 7, 2021 · 3 comments
Open

Comments

@AdamWill
Copy link

AdamWill commented May 7, 2021

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.

@kraih
Copy link

kraih commented May 7, 2021

I don't think Mango is maintained anymore.

@AdamWill
Copy link
Author

AdamWill commented May 7, 2021

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.

@ppisar
Copy link

ppisar commented May 10, 2021

There is a patch in fortl's fork in commit fortl@90f13e1. 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;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants