* Disposes of the client and releases all resources. * * This method clears all Cloudflare-specific state in addition to the base client cleanup. * It unsubscribes from span lifecycle events and clears pending span tracking. * * Call this method after flushing to allow the client to b
()
| 122 | * After calling dispose(), the client should not be used anymore. |
| 123 | */ |
| 124 | public override dispose(): void { |
| 125 | DEBUG_BUILD && debug.log('[CloudflareClient] Disposing client...'); |
| 126 | |
| 127 | super.dispose(); |
| 128 | |
| 129 | if (this._unsubscribeSpanStart) { |
| 130 | this._unsubscribeSpanStart(); |
| 131 | this._unsubscribeSpanStart = null; |
| 132 | } |
| 133 | if (this._unsubscribeSpanEnd) { |
| 134 | this._unsubscribeSpanEnd(); |
| 135 | this._unsubscribeSpanEnd = null; |
| 136 | } |
| 137 | |
| 138 | this._resetSpanCompletionPromise(); |
| 139 | (this as unknown as { _flushLock: ReturnType<typeof makeFlushLock> | void })._flushLock = undefined; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Resets the span completion promise and resolve function. |
no test coverage detected