File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,7 @@ async def pipe(
66
66
writer : ByteSendStream ,
67
67
set_event_on_receive : bool ,
68
68
):
69
- while True :
70
- try :
71
- data = await reader .receive (1000 )
72
- except anyio .EndOfStream :
73
- break
74
- # print(f"{name} read {len(data)} delay {self.delay}")
69
+ async for data in reader :
75
70
if set_event_on_receive :
76
71
self .send_event .set ()
77
72
@@ -212,7 +207,6 @@ def set_delay(delay: float):
212
207
async with RedisCluster .from_url (
213
208
f"redis://{ hostname } :{ remap_base } " , address_remap = remap
214
209
) as r :
215
- await r .initialize ()
216
210
await r .set ("foo" , "foo" )
217
211
await r .set ("bar" , "bar" )
218
212
@@ -223,6 +217,7 @@ async def op(r):
223
217
all_clear ()
224
218
async with anyio .create_task_group () as tg :
225
219
# Wait for whichever DelayProxy gets the request first
220
+ tg .start_soon (op , r )
226
221
await wait_for_send ()
227
222
await anyio .sleep (0.01 )
228
223
tg .cancel_scope .cancel ()
You can’t perform that action at this time.
0 commit comments