* Send batch request
()
| 82 | * Send batch request |
| 83 | */ |
| 84 | private async sendBatch(): Promise<void> { |
| 85 | if (this.queue.length === 0) { |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | const requestData = [...this.queue]; |
| 90 | this.queue = []; |
| 91 | this.timer = null; |
| 92 | |
| 93 | await this.options.onBatchSend(requestData); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Flush batch queue manually (send all pending requests immediately) |