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
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 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
|
__add__(step)
Generate incremental backoff.
Source code in waiter/__init__.py
165 166 167 |
|
__aiter__()
async
Asynchronously generate a slow loop of elapsed time.
Source code in waiter/__init__.py
110 111 112 113 114 115 116 117 118 119 |
|
__ge__(floor)
Limit minimum delay generated.
Source code in waiter/__init__.py
161 162 163 |
|
__getitem__(slc)
Slice delays, e.g., to limit attempt count.
Source code in waiter/__init__.py
153 154 155 |
|
__iter__()
Generate a slow loop of elapsed time.
Source code in waiter/__init__.py
99 100 101 102 103 104 105 106 107 108 |
|
__le__(ceiling)
Limit maximum delay generated.
Source code in waiter/__init__.py
157 158 159 |
|
__mul__(factor)
Generate exponential backoff.
Source code in waiter/__init__.py
169 170 171 |
|
accumulate(*args, **kwargs)
classmethod
Create waiter based on itertools.accumulate
.
Source code in waiter/__init__.py
138 139 140 141 |
|
count(*args, **kwargs)
classmethod
Create waiter based on itertools.count
.
Source code in waiter/__init__.py
133 134 135 136 |
|
exponential(base, **kwargs)
classmethod
Create waiter with exponential backoff.
Source code in waiter/__init__.py
143 144 145 146 |
|
fibonacci(delay, **kwargs)
classmethod
Create waiter with fibonacci backoff.
Source code in waiter/__init__.py
128 129 130 131 |
|
filtered(predicate, func, iterable)
Generate arg, func(arg)
pairs while predicate evaluates to true.
Source code in waiter/__init__.py
209 210 211 212 213 214 215 216 217 |
|
map(func, *iterables)
Return new waiter with function mapped across delays.
Source code in waiter/__init__.py
124 125 126 |
|
polling(predicate)
Return a decorator for poll
.
Source code in waiter/__init__.py
264 265 266 |
|
polynomial(exp, **kwargs)
classmethod
Create waiter with polynomial backoff.
Source code in waiter/__init__.py
148 149 150 151 |
|
random(start, stop)
Add random jitter within given range.
Source code in waiter/__init__.py
173 174 175 |
|
repeating(func)
A decorator for repeat
.
Source code in waiter/__init__.py
256 257 258 |
|
retrying(exception)
Return a decorator for retry
.
Source code in waiter/__init__.py
260 261 262 |
|
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
189 190 191 192 193 194 195 196 197 198 |
|
suppressed(exception, func, iterable)
Generate arg, func(arg)
pairs while exception isn't raised.
Source code in waiter/__init__.py
200 201 202 203 204 205 206 207 |
|
waiter.suppress(*exceptions)
Variant of contextlib.suppress
, which also records exception.
Source code in waiter/__init__.py
26 27 28 29 30 31 32 33 |
|
waiter.first(predicate, iterable, *default)
Return first item which evaluates to true, like any
with filtering.
Source code in waiter/__init__.py
36 37 38 |
|