appium-espresso-driver 9.3.7 → 9.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/lib/commands/context.d.ts +1 -1
- package/build/lib/commands/context.js +1 -1
- package/build/lib/commands/element.d.ts +10 -10
- package/build/lib/commands/element.js +10 -10
- package/build/lib/commands/idling-resources.d.ts +1 -1
- package/build/lib/commands/idling-resources.js +1 -1
- package/build/lib/commands/misc.d.ts +5 -4
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +3 -3
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/services.d.ts +2 -2
- package/build/lib/commands/services.js +2 -2
- package/build/lib/driver.js +1 -1
- package/build/lib/driver.js.map +1 -1
- package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
- package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.bin +0 -0
- package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.lock +0 -0
- package/espresso-server/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/espresso-server/buildSrc/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin +0 -0
- package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
- package/lib/commands/context.ts +1 -1
- package/lib/commands/element.ts +10 -10
- package/lib/commands/idling-resources.ts +1 -1
- package/lib/commands/misc.ts +5 -4
- package/lib/commands/services.ts +2 -2
- package/lib/driver.ts +1 -1
- package/node_modules/@appium/base-driver/node_modules/asyncbox/LICENSE +203 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/README.md +215 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts +84 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +1 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js +3 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js.map +1 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/package.json +3 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts +84 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts.map +1 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js +2 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js.map +1 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/package.json +3 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/types.ts +88 -0
- package/node_modules/@appium/base-driver/node_modules/asyncbox/package.json +74 -0
- package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +203 -0
- package/node_modules/@appium/support/node_modules/asyncbox/README.md +215 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +103 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +311 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +84 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +3 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +3 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +103 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +298 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +84 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +2 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +1 -0
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +3 -0
- package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +382 -0
- package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +88 -0
- package/node_modules/@appium/support/node_modules/asyncbox/package.json +74 -0
- package/node_modules/appium-android-driver/CHANGELOG.md +6 -0
- package/node_modules/appium-android-driver/build/lib/commands/context/exports.d.ts.map +1 -1
- package/node_modules/appium-android-driver/build/lib/commands/context/exports.js +9 -5
- package/node_modules/appium-android-driver/build/lib/commands/context/exports.js.map +1 -1
- package/node_modules/appium-android-driver/lib/commands/context/exports.ts +9 -5
- package/node_modules/appium-android-driver/package.json +1 -1
- package/node_modules/appium-chromedriver/CHANGELOG.md +14 -0
- package/node_modules/appium-chromedriver/build/lib/commands/version.d.ts.map +1 -1
- package/node_modules/appium-chromedriver/build/lib/commands/version.js +9 -0
- package/node_modules/appium-chromedriver/build/lib/commands/version.js.map +1 -1
- package/node_modules/appium-chromedriver/config/mapping.json +1 -0
- package/node_modules/appium-chromedriver/lib/commands/version.ts +10 -0
- package/node_modules/appium-chromedriver/package.json +2 -2
- package/node_modules/asyncbox/README.md +43 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
- package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
- package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
- package/node_modules/asyncbox/lib/errors.ts +15 -0
- package/node_modules/asyncbox/lib/index.ts +21 -0
- package/node_modules/asyncbox/lib/limit-function.ts +18 -0
- package/node_modules/asyncbox/lib/lock.ts +360 -0
- package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
- package/node_modules/asyncbox/lib/retry.ts +61 -0
- package/node_modules/asyncbox/lib/sleep.ts +79 -0
- package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
- package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
- package/node_modules/asyncbox/package.json +8 -8
- package/node_modules/io.appium.settings/CHANGELOG.md +7 -0
- package/node_modules/io.appium.settings/apks/settings_apk-debug.apk +0 -0
- package/node_modules/io.appium.settings/package.json +2 -2
- package/node_modules/on-finished/index.js +14 -2
- package/node_modules/on-finished/package.json +11 -7
- package/package.json +4 -4
- package/node_modules/on-finished/HISTORY.md +0 -98
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/cjs/lib/asyncbox.d.ts +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/cjs/lib/asyncbox.d.ts.map +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/cjs/lib/asyncbox.js +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/cjs/lib/asyncbox.js.map +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/esm/lib/asyncbox.d.ts +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/esm/lib/asyncbox.d.ts.map +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/esm/lib/asyncbox.js +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/build/esm/lib/asyncbox.js.map +0 -0
- /package/node_modules/{asyncbox → @appium/base-driver/node_modules/asyncbox}/lib/asyncbox.ts +0 -0
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.1.6](https://github.com/appium/appium-android/compare/appium-chromedriver@9.1.5...appium-chromedriver@9.1.6) (2026-10-23)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **chromedriver:** read Chrome's own version for a Chrome browser session ([#44](https://github.com/appium/appium-android/issues/44)) ([ac3cbe3](https://github.com/appium/appium-android/commit/ac3cbe3106d9691d11aeedf6032706878c9e44c6))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [9.1.5](https://github.com/appium/appium-android/compare/appium-chromedriver@9.1.4...appium-chromedriver@9.1.5) (2026-10-21)
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* **chromedriver:** ChromeDriver Bump to v156.0.8078.47 ([#39](https://github.com/appium/appium-android/issues/39)) ([bd9376f](https://github.com/appium/appium-android/commit/bd9376f30204d80f31efc8c91fce01affbcd51e4))
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [9.1.4](https://github.com/appium/appium-android/compare/appium-chromedriver@9.1.3...appium-chromedriver@9.1.4) (2026-10-17)
|
|
7
21
|
|
|
8
22
|
### Miscellaneous Chores
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../lib/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../lib/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAIjC,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,YAAY,CAAC;AAQ3D;;GAEG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAgC/B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as semver from 'semver';
|
|
2
2
|
import { getChromeVersion } from '../utils.js';
|
|
3
|
+
import { getCapValue } from './session.js';
|
|
3
4
|
const CHROME_BUNDLE_ID = 'com.android.chrome';
|
|
5
|
+
const CHROME_BROWSER_BUNDLE_IDS = [CHROME_BUNDLE_ID, 'com.chrome.beta', 'com.chrome.dev', 'com.chrome.canary'];
|
|
4
6
|
const WEBVIEW_SHELL_BUNDLE_ID = 'org.chromium.webview_shell';
|
|
5
7
|
const WEBVIEW_BUNDLE_IDS = ['com.google.android.webview', 'com.android.webview'];
|
|
6
8
|
const VERSION_PATTERN = /([\d.]+)/;
|
|
@@ -13,6 +15,13 @@ export async function getChromeVersionForAutodetection() {
|
|
|
13
15
|
if (fromDetails) {
|
|
14
16
|
return fromDetails;
|
|
15
17
|
}
|
|
18
|
+
// A Chrome browser session names its package, whose version may differ from the system WebView's.
|
|
19
|
+
if (!this.bundleId) {
|
|
20
|
+
const androidPackage = getCapValue(this.capabilities, 'chromeOptions')?.androidPackage;
|
|
21
|
+
if (CHROME_BROWSER_BUNDLE_IDS.includes(androidPackage)) {
|
|
22
|
+
this.bundleId = androidPackage;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
16
25
|
// In WebView shell mode, probe known system webview packages first.
|
|
17
26
|
if (this.bundleId === WEBVIEW_SHELL_BUNDLE_ID) {
|
|
18
27
|
return await resolveChromeVersionForWebviewShell(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../lib/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,C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3
3
|
import {getChromeVersion} from '../utils.js';
|
|
4
|
+
import {getCapValue} from './session.js';
|
|
4
5
|
import type {ChromedriverCommandContext} from './types.js';
|
|
5
6
|
|
|
6
7
|
const CHROME_BUNDLE_ID = 'com.android.chrome';
|
|
8
|
+
const CHROME_BROWSER_BUNDLE_IDS = [CHROME_BUNDLE_ID, 'com.chrome.beta', 'com.chrome.dev', 'com.chrome.canary'] as const;
|
|
7
9
|
const WEBVIEW_SHELL_BUNDLE_ID = 'org.chromium.webview_shell';
|
|
8
10
|
const WEBVIEW_BUNDLE_IDS = ['com.google.android.webview', 'com.android.webview'] as const;
|
|
9
11
|
const VERSION_PATTERN = /([\d.]+)/;
|
|
@@ -20,6 +22,14 @@ export async function getChromeVersionForAutodetection(
|
|
|
20
22
|
return fromDetails;
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
// A Chrome browser session names its package, whose version may differ from the system WebView's.
|
|
26
|
+
if (!this.bundleId) {
|
|
27
|
+
const androidPackage = getCapValue(this.capabilities, 'chromeOptions')?.androidPackage;
|
|
28
|
+
if (CHROME_BROWSER_BUNDLE_IDS.includes(androidPackage)) {
|
|
29
|
+
this.bundleId = androidPackage;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
// In WebView shell mode, probe known system webview packages first.
|
|
24
34
|
if (this.bundleId === WEBVIEW_SHELL_BUNDLE_ID) {
|
|
25
35
|
return await resolveChromeVersionForWebviewShell(this);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-chromedriver",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.6",
|
|
4
4
|
"description": "Node.js wrapper around chromedriver.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
70
70
|
"npm": ">=10"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "3e911805e42b4f39d63bbc5130ee6227375d7d51"
|
|
73
73
|
}
|
|
@@ -208,6 +208,49 @@ try {
|
|
|
208
208
|
}
|
|
209
209
|
```
|
|
210
210
|
|
|
211
|
+
### AsyncLock
|
|
212
|
+
|
|
213
|
+
A promise-based mutex keyed by string, derived from the unmaintained
|
|
214
|
+
[async-lock](https://github.com/rogierschouten/async-lock) (MIT). Tasks with the
|
|
215
|
+
same key run one at a time in FIFO order; different keys run concurrently.
|
|
216
|
+
|
|
217
|
+
Differences from `async-lock`: promises only (no callbacks, custom `Promise`
|
|
218
|
+
or domain support), and each task runs in the `AsyncLocalStorage` context of
|
|
219
|
+
its own `acquire` caller instead of the previous lock holder's one, so no
|
|
220
|
+
`AsyncResource.bind` is needed. A task that outlives `maxExecutionTime` can no
|
|
221
|
+
longer release the lock a second time, and queued tasks that time out are
|
|
222
|
+
removed from the queue.
|
|
223
|
+
|
|
224
|
+
```js
|
|
225
|
+
import {AsyncLock} from 'asyncbox';
|
|
226
|
+
|
|
227
|
+
const lock = new AsyncLock({maxPending: 10});
|
|
228
|
+
|
|
229
|
+
const result = await lock.acquire('key', async () => {
|
|
230
|
+
// runs exclusively for 'key'
|
|
231
|
+
return 42;
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// several keys are held together; they are acquired in sorted order, so overlapping calls cannot deadlock
|
|
235
|
+
await lock.acquire(['key1', 'key2'], () => {});
|
|
236
|
+
|
|
237
|
+
// per-call options: timeout, maxOccupationTime, maxExecutionTime, maxPending, skipQueue
|
|
238
|
+
await lock.acquire('key', () => {}, {timeout: 5000, skipQueue: true});
|
|
239
|
+
|
|
240
|
+
lock.getQueueLength('key'); // tasks waiting for the key (the running one is not counted)
|
|
241
|
+
lock.isBusy('key'); // running or pending tasks for the key
|
|
242
|
+
lock.isBusy(); // any key
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Options can be passed to the constructor and overridden per `acquire` call.
|
|
246
|
+
Times are in ms, up to 2147483647, and `0` means no limit.
|
|
247
|
+
|
|
248
|
+
- `timeout` (default `0`) - max wait in the queue (for all the keys of a multi-key call together) before the task is rejected and dropped
|
|
249
|
+
- `maxOccupationTime` (default `0`) - max time from `acquire` to completion, queue wait included; one budget is shared by all keys of a multi-key call
|
|
250
|
+
- `maxExecutionTime` (default `0`) - max time the task may run while holding the lock; the lock is released when exceeded (for a multi-key call, it counts from when all keys are held and releases all of them)
|
|
251
|
+
- `maxPending` (default `1000`) - max tasks waiting per key; further ones are rejected right away, so `0` rejects every task that would have to wait
|
|
252
|
+
- `skipQueue` (default `false`, per call only) - put the task at the front of the queue
|
|
253
|
+
|
|
211
254
|
### Run the tests
|
|
212
255
|
|
|
213
256
|
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MapFilterOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
|
|
4
|
+
* @param coll - The collection to filter
|
|
5
|
+
* @param filter - The function to test each element
|
|
6
|
+
* @param options - Options for controlling parallelism (default: true - fully parallel)
|
|
7
|
+
*/
|
|
8
|
+
export declare function asyncfilter<T>(coll: T[], filter: (value: T) => boolean | Promise<boolean>, options?: MapFilterOptions): Promise<T[]>;
|
|
9
|
+
//# sourceMappingURL=asyncfilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAwBd"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asyncfilter = asyncfilter;
|
|
4
|
+
const limit_function_js_1 = require("./limit-function.js");
|
|
5
|
+
/**
|
|
6
|
+
* Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
|
|
7
|
+
* @param coll - The collection to filter
|
|
8
|
+
* @param filter - The function to test each element
|
|
9
|
+
* @param options - Options for controlling parallelism (default: true - fully parallel)
|
|
10
|
+
*/
|
|
11
|
+
async function asyncfilter(coll, filter, options = true) {
|
|
12
|
+
if (options === null) {
|
|
13
|
+
throw new Error('Options cannot be null');
|
|
14
|
+
}
|
|
15
|
+
// limitFunction requires the filter to always return a promise
|
|
16
|
+
const filterAsync = async (value) => filter(value);
|
|
17
|
+
if (options === false) {
|
|
18
|
+
return coll.reduce(async (accP, item) => {
|
|
19
|
+
const acc = await accP;
|
|
20
|
+
if (await filterAsync(item)) {
|
|
21
|
+
acc.push(item);
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, Promise.resolve([]));
|
|
25
|
+
}
|
|
26
|
+
const adjustedFilter = options === true ? filterAsync : (await (0, limit_function_js_1.getLimitFunction)())(filterAsync, { concurrency: options.concurrency });
|
|
27
|
+
const bools = await Promise.all(coll.map(adjustedFilter));
|
|
28
|
+
return coll.reduce((acc, item, i) => {
|
|
29
|
+
if (bools[i]) {
|
|
30
|
+
acc.push(item);
|
|
31
|
+
}
|
|
32
|
+
return acc;
|
|
33
|
+
}, []);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=asyncfilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":";;AASA,kCA4BC;AArCD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAC/B,IAAS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FilterOptions } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
|
|
4
|
+
* @param coll - The collection to map over
|
|
5
|
+
* @param mapper - The function to apply to each element
|
|
6
|
+
* @param options - Options for controlling parallelism (default: true - fully parallel)
|
|
7
|
+
*/
|
|
8
|
+
export declare function asyncmap<T, R>(coll: T[], mapper: (value: T) => R | Promise<R>, options?: MapFilterOptions): Promise<R[]>;
|
|
9
|
+
//# sourceMappingURL=asyncmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncmap.d.ts","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAed"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asyncmap = asyncmap;
|
|
4
|
+
const limit_function_js_1 = require("./limit-function.js");
|
|
5
|
+
/**
|
|
6
|
+
* Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
|
|
7
|
+
* @param coll - The collection to map over
|
|
8
|
+
* @param mapper - The function to apply to each element
|
|
9
|
+
* @param options - Options for controlling parallelism (default: true - fully parallel)
|
|
10
|
+
*/
|
|
11
|
+
async function asyncmap(coll, mapper, options = true) {
|
|
12
|
+
if (options === null) {
|
|
13
|
+
throw new Error('Options cannot be null');
|
|
14
|
+
}
|
|
15
|
+
// limitFunction requires the mapper to always return a promise
|
|
16
|
+
const mapperAsync = async (value) => mapper(value);
|
|
17
|
+
if (options === false) {
|
|
18
|
+
return coll.reduce(async (acc, item) => [...(await acc), await mapperAsync(item)], Promise.resolve([]));
|
|
19
|
+
}
|
|
20
|
+
const adjustedMapper = options === true ? mapperAsync : (await (0, limit_function_js_1.getLimitFunction)())(mapperAsync, { concurrency: options.concurrency });
|
|
21
|
+
return Promise.all(coll.map(adjustedMapper));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=asyncmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":";;AASA,4BAmBC;AA5BD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAC5B,IAAS,EACT,MAAoC,EACpC,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAc,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,MAAM,CAChB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,EAC9D,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,CAAC;IACJ,CAAC;IACD,MAAM,cAAc,GAClB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAgB,GAAE,CAAC,CAAC,WAAW,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAC,CAAC,CAAC;IAC/G,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Error thrown by {@link withTimeout} when the deadline is exceeded. */
|
|
2
|
+
export declare class TimeoutError extends Error {
|
|
3
|
+
constructor(message?: string);
|
|
4
|
+
}
|
|
5
|
+
/** Thrown when a promise is cancelled via `cancel`. */
|
|
6
|
+
export declare class PromiseCancellationError extends Error {
|
|
7
|
+
constructor(message?: string);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../lib/errors.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,GAAE,MAA4B;CAIlD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromiseCancellationError = exports.TimeoutError = void 0;
|
|
4
|
+
/** Error thrown by {@link withTimeout} when the deadline is exceeded. */
|
|
5
|
+
class TimeoutError extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message ?? 'Operation timed out');
|
|
8
|
+
this.name = 'TimeoutError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TimeoutError = TimeoutError;
|
|
12
|
+
/** Thrown when a promise is cancelled via `cancel`. */
|
|
13
|
+
class PromiseCancellationError extends Error {
|
|
14
|
+
constructor(message = 'Promise cancelled') {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = 'PromiseCancellationError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PromiseCancellationError = PromiseCancellationError;
|
|
20
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../lib/errors.ts"],"names":[],"mappings":";;;AAAA,yEAAyE;AACzE,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,qBAAqB,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AALD,oCAKC;AAED,uDAAuD;AACvD,MAAa,wBAAyB,SAAQ,KAAK;IACjD,YAAY,UAAkB,mBAAmB;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AALD,4DAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { TimeoutError, PromiseCancellationError } from './errors.js';
|
|
2
|
+
export { sleep } from './sleep.js';
|
|
3
|
+
export { withTimeout } from './with-timeout.js';
|
|
4
|
+
export { longSleep } from './long-sleep.js';
|
|
5
|
+
export { retry, retryInterval } from './retry.js';
|
|
6
|
+
export { asyncmap } from './asyncmap.js';
|
|
7
|
+
export { asyncfilter } from './asyncfilter.js';
|
|
8
|
+
export { waitForCondition } from './wait-for-condition.js';
|
|
9
|
+
export { AsyncLock } from './lock.js';
|
|
10
|
+
export type { AsyncLockOptions, AcquireOptions } from './lock.js';
|
|
11
|
+
export type { CancellablePromise, Progress, ProgressCallback, LongSleepOptions, MapFilterOptions, SleepArg, SleepOptions, WaitForConditionOptions, } from './types.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,aAAa,CAAC;AACnE,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAEpC,YAAY,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAChE,YAAY,EACV,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncLock = exports.waitForCondition = exports.asyncfilter = exports.asyncmap = exports.retryInterval = exports.retry = exports.longSleep = exports.withTimeout = exports.sleep = exports.PromiseCancellationError = exports.TimeoutError = void 0;
|
|
4
|
+
var errors_js_1 = require("./errors.js");
|
|
5
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_js_1.TimeoutError; } });
|
|
6
|
+
Object.defineProperty(exports, "PromiseCancellationError", { enumerable: true, get: function () { return errors_js_1.PromiseCancellationError; } });
|
|
7
|
+
var sleep_js_1 = require("./sleep.js");
|
|
8
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_js_1.sleep; } });
|
|
9
|
+
var with_timeout_js_1 = require("./with-timeout.js");
|
|
10
|
+
Object.defineProperty(exports, "withTimeout", { enumerable: true, get: function () { return with_timeout_js_1.withTimeout; } });
|
|
11
|
+
var long_sleep_js_1 = require("./long-sleep.js");
|
|
12
|
+
Object.defineProperty(exports, "longSleep", { enumerable: true, get: function () { return long_sleep_js_1.longSleep; } });
|
|
13
|
+
var retry_js_1 = require("./retry.js");
|
|
14
|
+
Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return retry_js_1.retry; } });
|
|
15
|
+
Object.defineProperty(exports, "retryInterval", { enumerable: true, get: function () { return retry_js_1.retryInterval; } });
|
|
16
|
+
var asyncmap_js_1 = require("./asyncmap.js");
|
|
17
|
+
Object.defineProperty(exports, "asyncmap", { enumerable: true, get: function () { return asyncmap_js_1.asyncmap; } });
|
|
18
|
+
var asyncfilter_js_1 = require("./asyncfilter.js");
|
|
19
|
+
Object.defineProperty(exports, "asyncfilter", { enumerable: true, get: function () { return asyncfilter_js_1.asyncfilter; } });
|
|
20
|
+
var wait_for_condition_js_1 = require("./wait-for-condition.js");
|
|
21
|
+
Object.defineProperty(exports, "waitForCondition", { enumerable: true, get: function () { return wait_for_condition_js_1.waitForCondition; } });
|
|
22
|
+
var lock_js_1 = require("./lock.js");
|
|
23
|
+
Object.defineProperty(exports, "AsyncLock", { enumerable: true, get: function () { return lock_js_1.AsyncLock; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":";;;AAAA,yCAAmE;AAA3D,yGAAA,YAAY,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAC9C,uCAAiC;AAAzB,iGAAA,KAAK,OAAA;AACb,qDAA8C;AAAtC,8GAAA,WAAW,OAAA;AACnB,iDAA0C;AAAlC,0GAAA,SAAS,OAAA;AACjB,uCAAgD;AAAxC,iGAAA,KAAK,OAAA;AAAE,yGAAA,aAAa,OAAA;AAC5B,6CAAuC;AAA/B,uGAAA,QAAQ,OAAA;AAChB,mDAA6C;AAArC,6GAAA,WAAW,OAAA;AACnB,iEAAyD;AAAjD,yHAAA,gBAAgB,OAAA;AACxB,qCAAoC;AAA5B,oGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-function.d.ts","sourceRoot":"","sources":["../../../lib/limit-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAc3C,wBAAsB,gBAAgB,kCAGrC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLimitFunction = getLimitFunction;
|
|
4
|
+
// p-limit is ESM-only. tsc downlevels a plain `import()` in CommonJS output into a
|
|
5
|
+
// require()-in-a-microtask, which still hits Node's require(esm) interop and can race with a
|
|
6
|
+
// concurrent dynamic import() of the same module elsewhere in the process
|
|
7
|
+
// (ERR_REQUIRE_ESM_RACE_CONDITION). Route through `new Function` so tsc can't see or rewrite the
|
|
8
|
+
// import() call, keeping it a genuine native dynamic import in both the ESM and CJS builds.
|
|
9
|
+
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
10
|
+
let limitFunctionPromise;
|
|
11
|
+
async function getLimitFunction() {
|
|
12
|
+
limitFunctionPromise ??= dynamicImport('p-limit');
|
|
13
|
+
return (await limitFunctionPromise).limitFunction;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=limit-function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-function.js","sourceRoot":"","sources":["../../../lib/limit-function.ts"],"names":[],"mappings":";;AAcA,4CAGC;AAbD,mFAAmF;AACnF,6FAA6F;AAC7F,0EAA0E;AAC1E,iGAAiG;AACjG,4FAA4F;AAC5F,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAEhD,CAAC;AAE3B,IAAI,oBAAuD,CAAC;AACrD,KAAK,UAAU,gBAAgB;IACpC,oBAAoB,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,aAAa,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Options shared by the {@link AsyncLock} constructor and {@link AsyncLock.acquire}. */
|
|
2
|
+
export interface AsyncLockOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Max ms a task may wait in the queue before failing. `0` means never.
|
|
5
|
+
* @default 0
|
|
6
|
+
*/
|
|
7
|
+
timeout?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Max ms between calling `acquire` and the task finishing (queue wait included). `0` means never.
|
|
10
|
+
* @default 0
|
|
11
|
+
*/
|
|
12
|
+
maxOccupationTime?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Max ms the task may run once it holds the lock; the lock is then released. `0` means never.
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
maxExecutionTime?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Max number of tasks waiting per key; further ones are rejected right away. `0` rejects every
|
|
20
|
+
* task that would have to wait.
|
|
21
|
+
* @default 1000
|
|
22
|
+
*/
|
|
23
|
+
maxPending?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Per-call options of {@link AsyncLock.acquire}; override the constructor ones. */
|
|
26
|
+
export interface AcquireOptions extends AsyncLockOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Put the task at the front of the queue instead of the back.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
skipQueue?: boolean;
|
|
32
|
+
}
|
|
33
|
+
type Task<T> = () => T | PromiseLike<T>;
|
|
34
|
+
/**
|
|
35
|
+
* Promise-based mutex keyed by string. Tasks with the same key run one at a time, in FIFO order.
|
|
36
|
+
*
|
|
37
|
+
* Each task runs in the async context (`AsyncLocalStorage`) of the code that called
|
|
38
|
+
* {@link AsyncLock.acquire}, not in the context of the task that held the lock before it.
|
|
39
|
+
*/
|
|
40
|
+
export declare class AsyncLock {
|
|
41
|
+
private readonly queues;
|
|
42
|
+
private readonly defaults;
|
|
43
|
+
constructor(opts?: AsyncLockOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Run `fn` once the lock for `key` is free and release the lock when it settles.
|
|
46
|
+
*
|
|
47
|
+
* Multiple keys are held together. They are acquired one by one in sorted order, whatever order
|
|
48
|
+
* they are given in, so that overlapping calls cannot deadlock; duplicates are ignored. Keys that
|
|
49
|
+
* are already held stay held while a later one is awaited. `timeout` and `maxOccupationTime` are
|
|
50
|
+
* budgets for the whole call, while `maxExecutionTime` counts from the moment all the keys are
|
|
51
|
+
* held and releases all of them.
|
|
52
|
+
*
|
|
53
|
+
* @param key - Resource key, or a non-empty array of keys
|
|
54
|
+
* @param fn - Task to run while holding the lock; may be sync or async
|
|
55
|
+
* @param opts - Per-call options
|
|
56
|
+
* @returns The result of `fn`
|
|
57
|
+
* @throws {TypeError} Synchronously, if an argument is invalid
|
|
58
|
+
*/
|
|
59
|
+
acquire<T>(key: string | readonly string[], fn: Task<T>, opts?: AcquireOptions): Promise<T>;
|
|
60
|
+
/**
|
|
61
|
+
* Number of tasks waiting for `key`, not counting the running one.
|
|
62
|
+
*
|
|
63
|
+
* @param key - Resource key
|
|
64
|
+
*/
|
|
65
|
+
getQueueLength(key: string): number;
|
|
66
|
+
/**
|
|
67
|
+
* Whether `key` has a running or pending task. Without a key, whether any key does.
|
|
68
|
+
*
|
|
69
|
+
* @param key - Resource key
|
|
70
|
+
*/
|
|
71
|
+
isBusy(key?: string): boolean;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/lock.ts"],"names":[],"mappings":"AAMA,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAMxC;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;gBAE1C,IAAI,GAAE,gBAAqB;IAWvC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAkB/F;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAInC;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;CAG9B"}
|