Yeah, I have the same concern. How about having an argument to the method, stating if you want the sleep behaviour or not?

On Jul 31, 2013, at 12:52 PM, Johannes Plunien <notifications@github.com> wrote:

> In lib/Pithub/Repos/Stats.pm:
> 
> > +        method => 'GET',
> > +        path => sprintf(
> > +            '/repos/%s/%s/stats/contributors',
> > +            delete $args{user}, delete $args{repo}
> > +        ),
> > +        %args
> > +    };
> > +    my $res = $self->request(
> > +        %$req
> > +    );
> > +
> > +    while ($res->response->code == 202) {
> > +        warn "202 response, sleeping and redoing..";
> > +        sleep 5;
> > +        $res = $self->request(%$req);
> > +    }
> Let's say you use Pithub in a web app, this implementation could block one web app worker for 5 or more seconds. I would just return the 202 here. So everyone using Pithub can decide how to handle it.
> 
> —
> Reply to this email directly or view it on GitHub.
>