waiter Module

Delays between requests.

class wpull.waiter.LinearWaiter(wait=0.0, random_wait=False, max_wait=10.0)[source]

Bases: wpull.waiter.Waiter

A linear back-off waiter.

Parameters:
  • wait – The normal delay time
  • random_wait – If True, randomly perturb the delay time within a factor of 0.5 and 1.5
  • max_wait – The maximum delay time

This waiter will increment by values of 1 second.

get()[source]
increment()[source]
reset()[source]
class wpull.waiter.Waiter[source]

Bases: object

Base class for Waiters.

Waiters are counters that indicate the delay between requests.

get()[source]

Return the time in seconds.

increment()[source]

Increment the delay possibly due to an error.

reset()[source]

Reset the delay back to normal setting.