| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 91399c3 commit fc6c2de
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -225,10 +225,14 @@ async def fail(): | |||
| 225 | 225 | await asyncio.sleep(0) | |
| 226 | 226 | raise ValueError("no good") | |
| 227 | 227 | ||
| 228 | + async def blocked(): | ||
| 229 | + fut = asyncio.Future() | ||
| 230 | + await fut | ||
| 231 | + | ||
| 228 | 232 | async def run(): | |
| 229 | 233 | winner, index, excs = await asyncio.staggered.staggered_race( | |
| 230 | 234 | [ | |
| 231 | - lambda: asyncio.sleep(2, result="sleep2"), | ||
| 235 | + lambda: blocked(), | ||
| 232 | 236 | lambda: asyncio.sleep(1, result="sleep1"), | |
| 233 | 237 | lambda: fail() | |
| 234 | 238 | ], | |
| Back | FazBrowse Home | New Git URL |
0 commit comments