(msg *ServerComMessage)
| 1370 | } |
| 1371 | |
| 1372 | func (s *Session) serialize(msg *ServerComMessage) (int, any) { |
| 1373 | if s.proto == GRPC { |
| 1374 | msg := pbServSerialize(msg) |
| 1375 | // TODO: calculate and return the size of `msg`. |
| 1376 | return -1, msg |
| 1377 | } |
| 1378 | |
| 1379 | if s.isMultiplex() { |
| 1380 | // No need to serialize the message to bytes within the cluster. |
| 1381 | return -1, msg |
| 1382 | } |
| 1383 | |
| 1384 | out, _ := json.Marshal(msg) |
| 1385 | return len(out), out |
| 1386 | } |
| 1387 | |
| 1388 | // onBackgroundTimer marks background session as foreground and informs topics it's subscribed to. |
| 1389 | func (s *Session) onBackgroundTimer() { |
no test coverage detected