MCPcopy Create free account
hub / github.com/gorilla/websocket / PreparedMessage

Struct PreparedMessage

prepared.go:19–24  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

17// because the CPU and memory expensive compression operation can be executed
18// once for a given set of compression options.
19type 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.
27type prepareKey struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected