Skip to content

Commit 04b4c2d

Browse files
v2 cancel bit
1 parent 044db22 commit 04b4c2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/replit_river/v2/client_session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from replit_river.transport_options import MAX_MESSAGE_BUFFER_SIZE, TransportOptions
3939

4040

41+
STREAM_CANCEL_BIT = 0b00100 # Synonymous with the cancel bit in v2
4142
STREAM_CLOSED_BIT = 0b01000 # Synonymous with the cancel bit in v2
4243

4344

@@ -208,11 +209,10 @@ async def send_rpc[R, A](
208209
async with asyncio.timeout(timeout.total_seconds()):
209210
response = await output.get()
210211
except asyncio.TimeoutError as e:
211-
# TODO(dstewart) After protocol v2, change this to STREAM_CANCEL_BIT
212212
await self.send_message(
213213
stream_id=stream_id,
214-
control_flags=STREAM_CLOSED_BIT,
215-
payload={"type": "CLOSE"},
214+
control_flags=STREAM_CANCEL_BIT,
215+
payload={"type": "CANCEL"},
216216
service_name=service_name,
217217
procedure_name=procedure_name,
218218
span=span,

0 commit comments

Comments
 (0)