(self, event: RealtimeClientEvent | RealtimeClientEventParam)
| 823 | return message |
| 824 | |
| 825 | def send(self, event: RealtimeClientEvent | RealtimeClientEventParam) -> None: |
| 826 | data = ( |
| 827 | event.to_json(use_api_names=True, exclude_defaults=True, exclude_unset=True) |
| 828 | if isinstance(event, BaseModel) |
| 829 | else json.dumps(maybe_transform(event, RealtimeClientEventParam)) |
| 830 | ) |
| 831 | if self._is_reconnecting: |
| 832 | self._send_queue.enqueue(data) |
| 833 | return |
| 834 | try: |
| 835 | self._connection.send(data) |
| 836 | except Exception: |
| 837 | self._send_queue.enqueue(data) |
| 838 | raise |
| 839 | |
| 840 | def send_raw(self, data: bytes | str) -> None: |
| 841 | if self._is_reconnecting: |
no test coverage detected