You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74Lines changed: 74 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -354,6 +354,80 @@ import { NO_TIMEOUT } from '@message-queue-toolkit/core'
354
354
}
355
355
```
356
356
357
+
### Non-Blocking Mode
358
+
359
+
When `nonBlocking: true` is set, `init()` returns immediately if the resource is not available on the first check. Polling continues in the background, and you can use callbacks to be notified when resources become available.
360
+
361
+
**Important behaviors:**
362
+
- If the resource IS immediately available, `init()` returns normally with the resource ready
363
+
- If the resource is NOT immediately available, `init()` returns with `resourcesReady: false` (for SNS/SQS) or `queueArn: undefined` (for SQS)
364
+
- Background polling continues and invokes the callback when the resource becomes available
365
+
- For SNS+SQS consumers, the callback is only invoked when BOTH topic and queue are available
0 commit comments