* Writes a packet. * * @param packet * @private
(packet: Partial<Packet & { query: string; options: any }>)
| 502 | * @private |
| 503 | */ |
| 504 | _packet(packet: Partial<Packet & { query: string; options: any }>): void { |
| 505 | debug("writing packet %j", packet); |
| 506 | |
| 507 | const encodedPackets = this.encoder.encode(packet as Packet); |
| 508 | for (let i = 0; i < encodedPackets.length; i++) { |
| 509 | this.engine.write(encodedPackets[i], packet.options); |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | /** |
| 514 | * Clean up transport subscriptions and packet buffer. |