Reference
waiter.waiter
An iterable which sleeps for given delays. Aliased as wait
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delays |
iterable | number
|
any iterable of seconds, or a scalar which is repeated endlessly |
required |
timeout |
number
|
optional timeout for iteration |
float('inf')
|
Source code in waiter/__init__.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
__add__(step)
Generate incremental backoff.
Source code in waiter/__init__.py
149 150 151 |
|
__aiter__()
async
Asynchronously generate a slow loop of elapsed time.
Source code in waiter/__init__.py
94 95 96 97 98 99 100 101 102 103 |
|
__ge__(floor)
Limit minimum delay generated.
Source code in waiter/__init__.py
145 146 147 |
|
__getitem__(slc)
Slice delays, e.g., to limit attempt count.
Source code in waiter/__init__.py
137 138 139 |
|
__iter__()
Generate a slow loop of elapsed time.
Source code in waiter/__init__.py
83 84 85 86 87 88 89 90 91 92 |
|
__le__(ceiling)
Limit maximum delay generated.
Source code in waiter/__init__.py
141 142 143 |
|
__mul__(factor)
Generate exponential backoff.
Source code in waiter/__init__.py
153 154 155 |
|
accumulate(*args, **kwargs)
classmethod
Create waiter based on itertools.accumulate
.
Source code in waiter/__init__.py
122 123 124 125 |
|
count(*args, **kwargs)
classmethod
Create waiter based on itertools.count
.
Source code in waiter/__init__.py
117 118 119 120 |
|
exponential(base, **kwargs)
classmethod
Create waiter with exponential backoff.
Source code in waiter/__init__.py
127 128 129 130 |
|
fibonacci(delay, **kwargs)
classmethod
Create waiter with fibonacci backoff.
Source code in waiter/__init__.py
112 113 114 115 |
|
filtered(predicate, func, iterable)
Generate arg, func(arg)
pairs while predicate evaluates to true.
Source code in waiter/__init__.py
193 194 195 196 197 198 199 200 201 |
|
map(func, *iterables)
Return new waiter with function mapped across delays.
Source code in waiter/__init__.py
108 109 110 |
|
poll(predicate, func, *args, **kwargs)
Repeat function call until predicate evaluates to true.
Source code in waiter/__init__.py
228 229 230 231 232 |
|
polling(predicate)
Return a decorator for poll
.
Source code in waiter/__init__.py
248 249 250 |
|
polynomial(exp, **kwargs)
classmethod
Create waiter with polynomial backoff.
Source code in waiter/__init__.py
132 133 134 135 |
|
random(start, stop)
Add random jitter within given range.
Source code in waiter/__init__.py
157 158 159 |
|
repeat(func, *args, **kwargs)
Repeat function call.
Source code in waiter/__init__.py
203 204 205 206 207 |
|
repeating(func)
A decorator for repeat
.
Source code in waiter/__init__.py
240 241 242 |
|
retry(exception, func, *args, **kwargs)
Repeat function call until exception isn't raised.
Source code in waiter/__init__.py
213 214 215 216 217 218 219 220 |
|
retrying(exception)
Return a decorator for retry
.
Source code in waiter/__init__.py
244 245 246 |
|
stream(queue, size=None)
Generate chained values in groups from an iterable.
The queue can be extended while in use.
Source code in waiter/__init__.py
173 174 175 176 177 178 179 180 181 182 |
|
suppressed(exception, func, iterable)
Generate arg, func(arg)
pairs while exception isn't raised.
Source code in waiter/__init__.py
184 185 186 187 188 189 190 191 |
|
throttle(iterable)
Delay iteration.
Source code in waiter/__init__.py
161 162 163 164 |
|
waiter.suppress(*exceptions)
Variant of contextlib.suppress
, which also records exception.
Source code in waiter/__init__.py
21 22 23 24 25 26 27 28 |
|
waiter.first(predicate, iterable, *default)
Return first item which evaluates to true, like any
with filtering.
Source code in waiter/__init__.py
31 32 33 |
|