Send data to a connection encoded and framed. The data must be JSON-serializable. We assume that a single send call is a single frame to be sent on the connect.
(connection: IPCBase, data: Any)
| 35 | |
| 36 | |
| 37 | def send(connection: IPCBase, data: Any) -> None: |
| 38 | """Send data to a connection encoded and framed. |
| 39 | |
| 40 | The data must be JSON-serializable. We assume that a single send call is a |
| 41 | single frame to be sent on the connect. |
| 42 | """ |
| 43 | connection.write(json.dumps(data)) |
| 44 | |
| 45 | |
| 46 | class WriteToConn(TextIO): |