Skip to content

Commit e9d0bc6

Browse files
AbhiPrasadcursoragent
authored andcommitted
refactor jsdoc
1 parent 2e1ddb0 commit e9d0bc6

File tree

2 files changed

+2
-39
lines changed

2 files changed

+2
-39
lines changed

packages/node/src/integrations/anr/common.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { Contexts, DsnComponents, Primitive, SdkMetadata } from '@sentry/co
77
* and reports blocking events.
88
*
99
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
10-
* @see {@link https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/application-not-responding/}
1110
*/
1211
export interface AnrIntegrationOptions {
1312
/**

packages/node/src/integrations/anr/index.ts

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & Anr
119119
/**
120120
* Application Not Responding (ANR) integration for Node.js applications.
121121
*
122+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
123+
*
122124
* Detects when the Node.js main thread event loop is blocked for more than the configured
123125
* threshold (5 seconds by default) and reports these as Sentry events.
124126
*
@@ -163,9 +165,6 @@ type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & Anr
163165
* ],
164166
* });
165167
* ```
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/}
169168
*/
170169
export const anrIntegration = defineIntegration(_anrIntegration) as AnrReturn;
171170

@@ -286,42 +285,7 @@ export function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): P
286285
* are expected to block the event loop, such as intensive computational tasks or
287286
* synchronous I/O operations.
288287
*
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-
*
323288
* @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/}
325289
*/
326290
export function disableAnrDetectionForCallback<T>(callback: () => T | Promise<T>): T | Promise<T> {
327291
const integration = getClient()?.getIntegrationByName(INTEGRATION_NAME) as AnrInternal | undefined;

0 commit comments

Comments
 (0)