On Tue, May 22, 2012 at 9:20 PM, David L. Day via RT
<bug-Lingua-AtD@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=77309 >
>
> Okay - I think I've figured it out.
>
> First, yes the code is broken. It's supposed to throw an HTTPException
> when LWP::UserAgent receives an error (i.e. 404, 503, etc). It's not,
> and I'll have to figure that out. Maybe it's best just to die at that
> point rather than throw an exception. Let me know what you think.
Well, the exception is probably the better way to go, but silent
deaths are the worst possible scenario. Might want to just die as
first until you can figure out how to get the exception to work, or
have some sort of failsafe that will die if the exception doesn't come
out. At least you now have a testable failure (double result to get a
503), which might be worth throwing in as a *.t test.
(Test::Exception works wonders here.)
Show quoted text> Second, apparently there's a throttle on the service. I've found that if
> I sleep for one second between calls, everything's fine. But without it,
> I get a 503 on the second call. So I'll also add in a default throttle
> property that can be overridden. I'll experiment to find what seems to
> be reasonable and also ask on the AtD message boards about throttling.
> The API document says nothing.
Yeah, just as long as it's based on some sort of internal timestamp,
instead of an auto-sleep. For example, if the user does a AtD call,
does two seconds worth of work, and then calls AtD again, L:AtD should
make the API request right away, not sleep for an extra second.
Show quoted text> This may take me a week or so to straighten out, but if you sleep for
> one second between calls for now, that'll keep you moving forward.
Thanks for the updates. Keep me posted. I'm looking at potentially
creating a Test::Pod::Grammar module, using this module as its
interface to AtD.
--
Brendan Byrd <Perl@ResonatorSoft.org>
Brendan Byrd <BBYRD@CPAN.org>