Skip to content

Commit 7e5145b

Browse files
Distribute STREAM_CLOSED_BIT into the versioned sessions
1 parent 9a53b0f commit 7e5145b

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

src/replit_river/client_session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
from .rpc import (
3636
ACK_BIT,
37-
STREAM_CLOSED_BIT,
3837
STREAM_OPEN_BIT,
3938
ErrorType,
4039
InitType,
@@ -45,6 +44,9 @@
4544
logger = logging.getLogger(__name__)
4645

4746

47+
STREAM_CLOSED_BIT = 0x0004 # Synonymous with the cancel bit in v2
48+
49+
4850
class ClientSession(Session):
4951
def __init__(
5052
self,

src/replit_river/common_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from opentelemetry.trace import Span
88

99
from replit_river.messages import FailedSendingMessageException
10-
from replit_river.rpc import ACK_BIT, STREAM_CLOSED_BIT, TransportMessage
10+
from replit_river.rpc import ACK_BIT, TransportMessage
1111
from replit_river.seq_manager import InvalidMessageException
1212

1313
logger = logging.getLogger(__name__)

src/replit_river/rpc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
]
4949
ACK_BIT = 0x0001
5050
STREAM_OPEN_BIT = 0x0002
51-
STREAM_CLOSED_BIT = 0x0004 # Synonymous with the cancel bit in v2
5251

5352
# these codes are retriable
5453
# if the server sends a response with one of these codes,

src/replit_river/server_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@
2222

2323
from .rpc import (
2424
ACK_BIT,
25-
STREAM_CLOSED_BIT,
2625
STREAM_OPEN_BIT,
2726
GenericRpcHandlerBuilder,
2827
TransportMessage,
2928
TransportMessageTracingSetter,
3029
)
3130

3231

32+
STREAM_CLOSED_BIT = 0x0004 # Synonymous with the cancel bit in v2
33+
34+
3335
logger = logging.getLogger(__name__)
3436

37+
3538
trace_propagator = TraceContextTextMapPropagator()
3639
trace_setter = TransportMessageTracingSetter()
3740

src/replit_river/v2/client_session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
)
2828
from replit_river.rpc import (
2929
ACK_BIT,
30-
STREAM_CLOSED_BIT,
3130
STREAM_OPEN_BIT,
3231
)
3332
from replit_river.seq_manager import (
@@ -38,6 +37,10 @@
3837
from replit_river.session import Session
3938
from replit_river.transport_options import MAX_MESSAGE_BUFFER_SIZE, TransportOptions
4039

40+
41+
STREAM_CLOSED_BIT = 0x0004 # Synonymous with the cancel bit in v2
42+
43+
4144
logger = logging.getLogger(__name__)
4245

4346

0 commit comments

Comments
 (0)