|
16 | 16 | class MessageWrapper(BaseModel): |
17 | 17 | message_id: str |
18 | 18 | payload: str |
19 | | - |
| 19 | + |
20 | 20 | def get_json_rpc_message(self) -> types.JSONRPCMessage | ValidationError: |
21 | 21 | """Parse the payload into a JSONRPCMessage or return ValidationError.""" |
22 | 22 | try: |
@@ -48,9 +48,12 @@ async def publish_message( |
48 | 48 | ... |
49 | 49 |
|
50 | 50 | async def publish_message_sync( |
51 | | - self, session_id: UUID, message: types.JSONRPCMessage | str, timeout: float = 30.0 |
| 51 | + self, |
| 52 | + session_id: UUID, |
| 53 | + message: types.JSONRPCMessage | str, |
| 54 | + timeout: float = 120.0, |
52 | 55 | ) -> bool: |
53 | | - """Publish a message for the specified session and wait for consumption confirmation. |
| 56 | + """Publish a message for the specified session and wait for confirmation. |
54 | 57 |
|
55 | 58 | This method blocks until the message has been fully consumed by the subscriber, |
56 | 59 | or until the timeout is reached. |
@@ -121,12 +124,15 @@ async def publish_message( |
121 | 124 |
|
122 | 125 | logger.debug(f"Message dispatched to session {session_id}") |
123 | 126 | return True |
124 | | - |
| 127 | + |
125 | 128 | async def publish_message_sync( |
126 | | - self, session_id: UUID, message: types.JSONRPCMessage | str, timeout: float = 30.0 |
| 129 | + self, |
| 130 | + session_id: UUID, |
| 131 | + message: types.JSONRPCMessage | str, |
| 132 | + timeout: float = 30.0, |
127 | 133 | ) -> bool: |
128 | 134 | """Publish a message for the specified session and wait for consumption. |
129 | | - |
| 135 | +
|
130 | 136 | For InMemoryMessageDispatch, this is the same as publish_message since |
131 | 137 | the callback is executed synchronously. |
132 | 138 | """ |
|
0 commit comments