PreparedMessage caches on the wire representations of a message payload. Use PreparedMessage to efficiently send a message payload to multiple connections. PreparedMessage is especially useful when compression is used because the CPU and memory expensive compression operation can be executed once fo
| 17 | // because the CPU and memory expensive compression operation can be executed |
| 18 | // once for a given set of compression options. |
| 19 | type PreparedMessage struct { |
| 20 | messageType int |
| 21 | data []byte |
| 22 | mu sync.Mutex |
| 23 | frames map[prepareKey]*preparedFrame |
| 24 | } |
| 25 | |
| 26 | // prepareKey defines a unique set of options to cache prepared frames in PreparedMessage. |
| 27 | type prepareKey struct { |
nothing calls this directly
no outgoing calls
no test coverage detected