@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
24 lines (23 loc) • 737 B
JavaScript
/**
* Async Utilities
*
* Centralized async/promise utilities for NeuroLink.
* Provides common patterns like delays, timeouts, and retry logic.
*
* @example
* ```typescript
* import { delay, withTimeout, retry } from './utils/async/index.js';
*
* // Simple delay
* await delay(1000);
*
* // Timeout protection
* const result = await withTimeout(fetchData(), 5000);
*
* // Retry with backoff
* const data = await retry(() => unreliableAPI(), { maxRetries: 3 });
* ```
*/
export { delay, sleep } from "./delay.js";
export { calculateBackoff, createRetry, DEFAULT_RETRY_OPTIONS, RetryExhaustedError, retry, } from "./retry.js";
export { TimeoutError, raceWithAbort, withTimeout, withTimeoutFn, } from "./withTimeout.js";