Send a JSON-RPC request. Returns the request id.
(self, method: str, params: dict[str, Any])
| 245 | return self._id |
| 246 | |
| 247 | def send_request(self, method: str, params: dict[str, Any]) -> int: |
| 248 | """Send a JSON-RPC request. Returns the request id.""" |
| 249 | rid = self._next_id() |
| 250 | q: queue.Queue[dict[str, Any]] = queue.Queue() |
| 251 | with self._pending_lock: |
| 252 | self._pending[rid] = q |
| 253 | self._send_raw({ |
| 254 | "jsonrpc": "2.0", |
| 255 | "id": rid, |
| 256 | "method": method, |
| 257 | "params": params, |
| 258 | }) |
| 259 | return rid |
| 260 | |
| 261 | def send_notification(self, method: str, params: dict[str, Any]) -> None: |
| 262 | """Send a JSON-RPC notification (no id, no response expected).""" |
no test coverage detected