Hi [email protected] one quick question.

I'm facing the same problem that you faced a long time ago, where you able 
to create or use a different module to throttle mojolicious requests?

Thanks in advantage.
Pablo

On Sunday, January 29, 2012 8:50:22 AM UTC-3, [email protected] wrote:
>
> Or maybe... Is there a ready-made module with functionality like this :
>
>
> # Try to do not more than 100 req./minute.
> # And allow not more than 4 reqs at once(online)
>
> my $l = Mojo::IOLoop::SomeLimiter->new(
>    period       => 60,  # 1 minute
>    limit        => 100, # 100/minute
>    limit_online => 4
> );
>
>
> $l->on(
>    process => sub {
>
>      my $l = shift;
>      if (my $d = shift @domains) {
>
>         mywhois($d => sub {
>          ... process answers ...
>
>          # request processed, increase number and decrease online
>          $l->finish();
>        });
>
>      }
>      else {
>        # all domains processed. Stop timers
>        $l->stop();
>      }
>    }
> );
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to