* Sends data. * * @param {String} data - data to send. * @param {Function} fn - called upon flush. * @private
(data: string, fn: () => void)
| 57 | * @private |
| 58 | */ |
| 59 | override doWrite(data: string, fn: () => void) { |
| 60 | const req = this.request({ |
| 61 | method: class="st">"POST", |
| 62 | data: data, |
| 63 | }); |
| 64 | req.on(class="st">"success", fn); |
| 65 | req.on(class="st">"error", (xhrStatus, context) => { |
| 66 | this.onError(class="st">"xhr post error", xhrStatus, context); |
| 67 | }); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Starts a poll cycle. |