@@ -119,6 +119,8 @@ type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & Anr
119
119
/**
120
120
* Application Not Responding (ANR) integration for Node.js applications.
121
121
*
122
+ * @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
123
+ *
122
124
* Detects when the Node.js main thread event loop is blocked for more than the configured
123
125
* threshold (5 seconds by default) and reports these as Sentry events.
124
126
*
@@ -163,9 +165,6 @@ type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & Anr
163
165
* ],
164
166
* });
165
167
* ```
166
- *
167
- * @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
168
- * @see {@link https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/application-not-responding/ }
169
168
*/
170
169
export const anrIntegration = defineIntegration ( _anrIntegration ) as AnrReturn ;
171
170
@@ -286,42 +285,7 @@ export function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): P
286
285
* are expected to block the event loop, such as intensive computational tasks or
287
286
* synchronous I/O operations.
288
287
*
289
- * ## Use Cases
290
- *
291
- * - CPU-intensive operations that legitimately block the event loop
292
- * - Synchronous file operations or database queries
293
- * - Intentional blocking operations during application startup
294
- * - Long-running computations that should not trigger ANR events
295
- *
296
- * ## Behavior
297
- *
298
- * - **Synchronous callbacks**: ANR detection is disabled before the callback runs
299
- * and re-enabled immediately after it completes
300
- * - **Asynchronous callbacks**: ANR detection is disabled before the callback runs
301
- * and re-enabled after the Promise resolves or rejects
302
- * - **No ANR integration**: If the ANR integration is not active, the callback
303
- * runs normally without any modifications
304
- *
305
- * @example
306
- * ```javascript
307
- * // For synchronous operations
308
- * const result = disableAnrDetectionForCallback(() => {
309
- * // Perform CPU-intensive work that might block for several seconds
310
- * return performHeavyComputation();
311
- * });
312
- *
313
- * // For asynchronous operations
314
- * const result = await disableAnrDetectionForCallback(async () => {
315
- * // Perform async work without ANR detection
316
- * return await heavyAsyncOperation();
317
- * });
318
- * ```
319
- *
320
- * @param callback - The function to execute with ANR detection disabled
321
- * @returns The result of the callback function
322
- *
323
288
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
324
- * @see {@link https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/application-not-responding/ }
325
289
*/
326
290
export function disableAnrDetectionForCallback < T > ( callback : ( ) => T | Promise < T > ) : T | Promise < T > {
327
291
const integration = getClient ( ) ?. getIntegrationByName ( INTEGRATION_NAME ) as AnrInternal | undefined ;
0 commit comments