Skip to content

Commit 7b4dd0e

Browse files
v2 cancel bit
1 parent 62ed6ea commit 7b4dd0e

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
@@ -37,6 +37,7 @@
3737
from replit_river.session import Session
3838
from replit_river.transport_options import MAX_MESSAGE_BUFFER_SIZE, TransportOptions
3939

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

4243

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

0 commit comments

Comments
 (0)