apify 2.3.1-beta.4 → 3.0.0-alpha.0
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/README.md +6 -5
- package/package.json +69 -128
- package/build/actor.d.ts +0 -113
- package/build/actor.d.ts.map +0 -1
- package/build/actor.js +0 -582
- package/build/actor.js.map +0 -1
- package/build/apify.d.ts +0 -752
- package/build/apify.d.ts.map +0 -1
- package/build/apify.js +0 -877
- package/build/apify.js.map +0 -1
- package/build/autoscaling/autoscaled_pool.d.ts +0 -384
- package/build/autoscaling/autoscaled_pool.d.ts.map +0 -1
- package/build/autoscaling/autoscaled_pool.js +0 -557
- package/build/autoscaling/autoscaled_pool.js.map +0 -1
- package/build/autoscaling/snapshotter.d.ts +0 -278
- package/build/autoscaling/snapshotter.d.ts.map +0 -1
- package/build/autoscaling/snapshotter.js +0 -447
- package/build/autoscaling/snapshotter.js.map +0 -1
- package/build/autoscaling/system_status.d.ts +0 -224
- package/build/autoscaling/system_status.d.ts.map +0 -1
- package/build/autoscaling/system_status.js +0 -228
- package/build/autoscaling/system_status.js.map +0 -1
- package/build/browser_launchers/browser_launcher.d.ts +0 -154
- package/build/browser_launchers/browser_launcher.d.ts.map +0 -1
- package/build/browser_launchers/browser_launcher.js +0 -160
- package/build/browser_launchers/browser_launcher.js.map +0 -1
- package/build/browser_launchers/browser_plugin.d.ts +0 -23
- package/build/browser_launchers/browser_plugin.d.ts.map +0 -1
- package/build/browser_launchers/browser_plugin.js +0 -25
- package/build/browser_launchers/browser_plugin.js.map +0 -1
- package/build/browser_launchers/playwright_launcher.d.ts +0 -131
- package/build/browser_launchers/playwright_launcher.d.ts.map +0 -1
- package/build/browser_launchers/playwright_launcher.js +0 -150
- package/build/browser_launchers/playwright_launcher.js.map +0 -1
- package/build/browser_launchers/puppeteer_launcher.d.ts +0 -153
- package/build/browser_launchers/puppeteer_launcher.d.ts.map +0 -1
- package/build/browser_launchers/puppeteer_launcher.js +0 -197
- package/build/browser_launchers/puppeteer_launcher.js.map +0 -1
- package/build/cache_container.d.ts +0 -31
- package/build/cache_container.d.ts.map +0 -1
- package/build/cache_container.js +0 -48
- package/build/cache_container.js.map +0 -1
- package/build/configuration.d.ts +0 -226
- package/build/configuration.d.ts.map +0 -1
- package/build/configuration.js +0 -325
- package/build/configuration.js.map +0 -1
- package/build/constants.d.ts +0 -37
- package/build/constants.d.ts.map +0 -1
- package/build/constants.js +0 -41
- package/build/constants.js.map +0 -1
- package/build/crawlers/basic_crawler.d.ts +0 -443
- package/build/crawlers/basic_crawler.d.ts.map +0 -1
- package/build/crawlers/basic_crawler.js +0 -664
- package/build/crawlers/basic_crawler.js.map +0 -1
- package/build/crawlers/browser_crawler.d.ts +0 -512
- package/build/crawlers/browser_crawler.d.ts.map +0 -1
- package/build/crawlers/browser_crawler.js +0 -540
- package/build/crawlers/browser_crawler.js.map +0 -1
- package/build/crawlers/cheerio_crawler.d.ts +0 -931
- package/build/crawlers/cheerio_crawler.d.ts.map +0 -1
- package/build/crawlers/cheerio_crawler.js +0 -913
- package/build/crawlers/cheerio_crawler.js.map +0 -1
- package/build/crawlers/crawler_extension.d.ts +0 -10
- package/build/crawlers/crawler_extension.d.ts.map +0 -1
- package/build/crawlers/crawler_extension.js +0 -19
- package/build/crawlers/crawler_extension.js.map +0 -1
- package/build/crawlers/crawler_utils.d.ts +0 -34
- package/build/crawlers/crawler_utils.d.ts.map +0 -1
- package/build/crawlers/crawler_utils.js +0 -87
- package/build/crawlers/crawler_utils.js.map +0 -1
- package/build/crawlers/playwright_crawler.d.ts +0 -448
- package/build/crawlers/playwright_crawler.d.ts.map +0 -1
- package/build/crawlers/playwright_crawler.js +0 -299
- package/build/crawlers/playwright_crawler.js.map +0 -1
- package/build/crawlers/puppeteer_crawler.d.ts +0 -425
- package/build/crawlers/puppeteer_crawler.d.ts.map +0 -1
- package/build/crawlers/puppeteer_crawler.js +0 -299
- package/build/crawlers/puppeteer_crawler.js.map +0 -1
- package/build/crawlers/statistics.d.ts +0 -185
- package/build/crawlers/statistics.d.ts.map +0 -1
- package/build/crawlers/statistics.js +0 -331
- package/build/crawlers/statistics.js.map +0 -1
- package/build/enqueue_links/click_elements.d.ts +0 -179
- package/build/enqueue_links/click_elements.d.ts.map +0 -1
- package/build/enqueue_links/click_elements.js +0 -434
- package/build/enqueue_links/click_elements.js.map +0 -1
- package/build/enqueue_links/enqueue_links.d.ts +0 -117
- package/build/enqueue_links/enqueue_links.d.ts.map +0 -1
- package/build/enqueue_links/enqueue_links.js +0 -163
- package/build/enqueue_links/enqueue_links.js.map +0 -1
- package/build/enqueue_links/shared.d.ts +0 -42
- package/build/enqueue_links/shared.d.ts.map +0 -1
- package/build/enqueue_links/shared.js +0 -121
- package/build/enqueue_links/shared.js.map +0 -1
- package/build/errors.d.ts +0 -29
- package/build/errors.d.ts.map +0 -1
- package/build/errors.js +0 -38
- package/build/errors.js.map +0 -1
- package/build/events.d.ts +0 -11
- package/build/events.d.ts.map +0 -1
- package/build/events.js +0 -147
- package/build/events.js.map +0 -1
- package/build/index.d.ts +0 -4
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -7
- package/build/index.js.map +0 -1
- package/build/main.d.ts +0 -179
- package/build/main.d.ts.map +0 -1
- package/build/main.js +0 -81
- package/build/main.js.map +0 -1
- package/build/playwright_utils.d.ts +0 -9
- package/build/playwright_utils.d.ts.map +0 -1
- package/build/playwright_utils.js +0 -90
- package/build/playwright_utils.js.map +0 -1
- package/build/proxy_configuration.d.ts +0 -411
- package/build/proxy_configuration.d.ts.map +0 -1
- package/build/proxy_configuration.js +0 -517
- package/build/proxy_configuration.js.map +0 -1
- package/build/pseudo_url.d.ts +0 -86
- package/build/pseudo_url.d.ts.map +0 -1
- package/build/pseudo_url.js +0 -153
- package/build/pseudo_url.js.map +0 -1
- package/build/puppeteer_request_interception.d.ts +0 -8
- package/build/puppeteer_request_interception.d.ts.map +0 -1
- package/build/puppeteer_request_interception.js +0 -235
- package/build/puppeteer_request_interception.js.map +0 -1
- package/build/puppeteer_utils.d.ts +0 -250
- package/build/puppeteer_utils.d.ts.map +0 -1
- package/build/puppeteer_utils.js +0 -551
- package/build/puppeteer_utils.js.map +0 -1
- package/build/request.d.ts +0 -180
- package/build/request.d.ts.map +0 -1
- package/build/request.js +0 -261
- package/build/request.js.map +0 -1
- package/build/request_list.d.ts +0 -581
- package/build/request_list.d.ts.map +0 -1
- package/build/request_list.js +0 -826
- package/build/request_list.js.map +0 -1
- package/build/serialization.d.ts +0 -5
- package/build/serialization.d.ts.map +0 -1
- package/build/serialization.js +0 -139
- package/build/serialization.js.map +0 -1
- package/build/session_pool/errors.d.ts +0 -11
- package/build/session_pool/errors.d.ts.map +0 -1
- package/build/session_pool/errors.js +0 -18
- package/build/session_pool/errors.js.map +0 -1
- package/build/session_pool/events.d.ts +0 -5
- package/build/session_pool/events.d.ts.map +0 -1
- package/build/session_pool/events.js +0 -6
- package/build/session_pool/events.js.map +0 -1
- package/build/session_pool/session.d.ts +0 -286
- package/build/session_pool/session.d.ts.map +0 -1
- package/build/session_pool/session.js +0 -355
- package/build/session_pool/session.js.map +0 -1
- package/build/session_pool/session_pool.d.ts +0 -280
- package/build/session_pool/session_pool.d.ts.map +0 -1
- package/build/session_pool/session_pool.js +0 -393
- package/build/session_pool/session_pool.js.map +0 -1
- package/build/session_pool/session_utils.d.ts +0 -4
- package/build/session_pool/session_utils.d.ts.map +0 -1
- package/build/session_pool/session_utils.js +0 -24
- package/build/session_pool/session_utils.js.map +0 -1
- package/build/stealth/hiding_tricks.d.ts +0 -22
- package/build/stealth/hiding_tricks.d.ts.map +0 -1
- package/build/stealth/hiding_tricks.js +0 -308
- package/build/stealth/hiding_tricks.js.map +0 -1
- package/build/stealth/stealth.d.ts +0 -56
- package/build/stealth/stealth.d.ts.map +0 -1
- package/build/stealth/stealth.js +0 -125
- package/build/stealth/stealth.js.map +0 -1
- package/build/storages/dataset.d.ts +0 -288
- package/build/storages/dataset.d.ts.map +0 -1
- package/build/storages/dataset.js +0 -480
- package/build/storages/dataset.js.map +0 -1
- package/build/storages/key_value_store.d.ts +0 -243
- package/build/storages/key_value_store.d.ts.map +0 -1
- package/build/storages/key_value_store.js +0 -462
- package/build/storages/key_value_store.js.map +0 -1
- package/build/storages/request_queue.d.ts +0 -318
- package/build/storages/request_queue.d.ts.map +0 -1
- package/build/storages/request_queue.js +0 -636
- package/build/storages/request_queue.js.map +0 -1
- package/build/storages/storage_manager.d.ts +0 -87
- package/build/storages/storage_manager.d.ts.map +0 -1
- package/build/storages/storage_manager.js +0 -150
- package/build/storages/storage_manager.js.map +0 -1
- package/build/tsconfig.tsbuildinfo +0 -1
- package/build/typedefs.d.ts +0 -146
- package/build/typedefs.d.ts.map +0 -1
- package/build/typedefs.js +0 -88
- package/build/typedefs.js.map +0 -1
- package/build/utils.d.ts +0 -175
- package/build/utils.d.ts.map +0 -1
- package/build/utils.js +0 -731
- package/build/utils.js.map +0 -1
- package/build/utils_log.d.ts +0 -41
- package/build/utils_log.d.ts.map +0 -1
- package/build/utils_log.js +0 -192
- package/build/utils_log.js.map +0 -1
- package/build/utils_request.d.ts +0 -77
- package/build/utils_request.d.ts.map +0 -1
- package/build/utils_request.js +0 -385
- package/build/utils_request.js.map +0 -1
- package/build/utils_social.d.ts +0 -210
- package/build/utils_social.d.ts.map +0 -1
- package/build/utils_social.js +0 -787
- package/build/utils_social.js.map +0 -1
- package/build/validators.d.ts +0 -23
- package/build/validators.d.ts.map +0 -1
- package/build/validators.js +0 -29
- package/build/validators.js.map +0 -1
package/build/apify.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apify.js","sourceRoot":"","sources":["../src/apify.js"],"names":[],"mappings":";;;;AAAA,yDAAoB;AACpB,0CAA2D;AAC3D,gDAAgD;AAChD,mCAAiC;AACjC,qCAAwD;AACxD,gEAA4D;AAC5D,gDAA6C;AAC7C,gEAA2E;AAC3E,iDAA8F;AAC9F,4DAAwD;AACxD,gDAAg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;QACL,OAAO;YACH,GAAG,mBAAW;YACd,SAAS,EAAE,gCAAc;YACzB,UAAU,EAAE,kCAAe;YAC3B,MAAM,EAAE,0BAAW;YACnB,GAAG,EAAH,mBAAG;YACH,YAAY,EAAZ,4BAAY;YACZ,gBAAgB,EAAhB,gCAAgB;SACnB,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,YAAY;QAC3B,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC1C,MAAM,OAAO,GAAG,IAAI,gCAAc,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC9D,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;SACpD;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,MAAM;QACrB,OAAO,MAAM,KAAK,yBAAgB,CAAC,SAAS;eACrC,MAAM,KAAK,yBAAgB,CAAC,OAAO;eACnC,MAAM,KAAK,yBAAgB,CAAC,KAAK,CAAC;IAC7C,CAAC;CACJ;AA34BD,sBA24BC"}
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
export default AutoscaledPool;
|
|
2
|
-
export type AutoscaledPoolOptions = {
|
|
3
|
-
/**
|
|
4
|
-
* A function that performs an asynchronous resource-intensive task.
|
|
5
|
-
* The function must either be labeled `async` or return a promise.
|
|
6
|
-
*/
|
|
7
|
-
runTaskFunction?: Function | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* A function that indicates whether `runTaskFunction` should be called.
|
|
10
|
-
* This function is called every time there is free capacity for a new task and it should
|
|
11
|
-
* indicate whether it should start a new task or not by resolving to either `true` or `false`.
|
|
12
|
-
* Besides its obvious use, it is also useful for task throttling to save resources.
|
|
13
|
-
*/
|
|
14
|
-
isTaskReadyFunction?: Function | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* A function that is called only when there are no tasks to be processed.
|
|
17
|
-
* If it resolves to `true` then the pool's run finishes. Being called only
|
|
18
|
-
* when there are no tasks being processed means that as long as `isTaskReadyFunction()`
|
|
19
|
-
* keeps resolving to `true`, `isFinishedFunction()` will never be called.
|
|
20
|
-
* To abort a run, use the {@link AutoscaledPoolabort } method.
|
|
21
|
-
*/
|
|
22
|
-
isFinishedFunction?: Function | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* The minimum number of tasks running in parallel.
|
|
25
|
-
*
|
|
26
|
-
* *WARNING:* If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.
|
|
27
|
-
* If you're not sure, just keep the default value and the concurrency will scale up automatically.
|
|
28
|
-
*/
|
|
29
|
-
minConcurrency?: number | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* The maximum number of tasks running in parallel.
|
|
32
|
-
*/
|
|
33
|
-
maxConcurrency?: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* The desired number of tasks that should be running parallel on the start of the pool,
|
|
36
|
-
* if there is a large enough supply of them.
|
|
37
|
-
* By default, it is `minConcurrency`.
|
|
38
|
-
*/
|
|
39
|
-
desiredConcurrency?: number | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Minimum level of desired concurrency to reach before more scaling up is allowed.
|
|
42
|
-
*/
|
|
43
|
-
desiredConcurrencyRatio?: number | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Defines the fractional amount of desired concurrency to be added with each scaling up.
|
|
46
|
-
* The minimum scaling step is one.
|
|
47
|
-
*/
|
|
48
|
-
scaleUpStepRatio?: number | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Defines the amount of desired concurrency to be subtracted with each scaling down.
|
|
51
|
-
* The minimum scaling step is one.
|
|
52
|
-
*/
|
|
53
|
-
scaleDownStepRatio?: number | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Indicates how often the pool should call the `runTaskFunction()` to start a new task, in seconds.
|
|
56
|
-
* This has no effect on starting new tasks immediately after a task completes.
|
|
57
|
-
*/
|
|
58
|
-
maybeRunIntervalSecs?: number | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Specifies a period in which the instance logs its state, in seconds.
|
|
61
|
-
* Set to `null` to disable periodic logging.
|
|
62
|
-
*/
|
|
63
|
-
loggingIntervalSecs?: number | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Defines in seconds how often the pool should attempt to adjust the desired concurrency
|
|
66
|
-
* based on the latest system status. Setting it lower than 1 might have a severe impact on performance.
|
|
67
|
-
* We suggest using a value from 5 to 20.
|
|
68
|
-
*/
|
|
69
|
-
autoscaleIntervalSecs?: number | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Timeout in which the `runTaskFunction` needs to finish, given in seconds.
|
|
72
|
-
*/
|
|
73
|
-
taskTimeoutSecs?: number | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Options to be passed down to the {@link Snapshotter } constructor. This is useful for fine-tuning
|
|
76
|
-
* the snapshot intervals and history.
|
|
77
|
-
*/
|
|
78
|
-
snapshotterOptions?: SnapshotterOptions | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Options to be passed down to the {@link SystemStatus } constructor. This is useful for fine-tuning
|
|
81
|
-
* the system status reports. If a custom snapshotter is set in the options, it will be used
|
|
82
|
-
* by the pool.
|
|
83
|
-
*/
|
|
84
|
-
systemStatusOptions?: SystemStatusOptions | undefined;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* @typedef AutoscaledPoolOptions
|
|
88
|
-
* @property {Function} [runTaskFunction]
|
|
89
|
-
* A function that performs an asynchronous resource-intensive task.
|
|
90
|
-
* The function must either be labeled `async` or return a promise.
|
|
91
|
-
*
|
|
92
|
-
* @property {Function} [isTaskReadyFunction]
|
|
93
|
-
* A function that indicates whether `runTaskFunction` should be called.
|
|
94
|
-
* This function is called every time there is free capacity for a new task and it should
|
|
95
|
-
* indicate whether it should start a new task or not by resolving to either `true` or `false`.
|
|
96
|
-
* Besides its obvious use, it is also useful for task throttling to save resources.
|
|
97
|
-
*
|
|
98
|
-
* @property {Function} [isFinishedFunction]
|
|
99
|
-
* A function that is called only when there are no tasks to be processed.
|
|
100
|
-
* If it resolves to `true` then the pool's run finishes. Being called only
|
|
101
|
-
* when there are no tasks being processed means that as long as `isTaskReadyFunction()`
|
|
102
|
-
* keeps resolving to `true`, `isFinishedFunction()` will never be called.
|
|
103
|
-
* To abort a run, use the {@link AutoscaledPool#abort} method.
|
|
104
|
-
*
|
|
105
|
-
* @property {number} [minConcurrency=1]
|
|
106
|
-
* The minimum number of tasks running in parallel.
|
|
107
|
-
*
|
|
108
|
-
* *WARNING:* If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.
|
|
109
|
-
* If you're not sure, just keep the default value and the concurrency will scale up automatically.
|
|
110
|
-
* @property {number} [maxConcurrency=1000]
|
|
111
|
-
* The maximum number of tasks running in parallel.
|
|
112
|
-
* @property {number} [desiredConcurrency]
|
|
113
|
-
* The desired number of tasks that should be running parallel on the start of the pool,
|
|
114
|
-
* if there is a large enough supply of them.
|
|
115
|
-
* By default, it is `minConcurrency`.
|
|
116
|
-
* @property {number} [desiredConcurrencyRatio=0.95]
|
|
117
|
-
* Minimum level of desired concurrency to reach before more scaling up is allowed.
|
|
118
|
-
* @property {number} [scaleUpStepRatio=0.05]
|
|
119
|
-
* Defines the fractional amount of desired concurrency to be added with each scaling up.
|
|
120
|
-
* The minimum scaling step is one.
|
|
121
|
-
* @property {number} [scaleDownStepRatio=0.05]
|
|
122
|
-
* Defines the amount of desired concurrency to be subtracted with each scaling down.
|
|
123
|
-
* The minimum scaling step is one.
|
|
124
|
-
* @property {number} [maybeRunIntervalSecs=0.5]
|
|
125
|
-
* Indicates how often the pool should call the `runTaskFunction()` to start a new task, in seconds.
|
|
126
|
-
* This has no effect on starting new tasks immediately after a task completes.
|
|
127
|
-
* @property {number} [loggingIntervalSecs=60]
|
|
128
|
-
* Specifies a period in which the instance logs its state, in seconds.
|
|
129
|
-
* Set to `null` to disable periodic logging.
|
|
130
|
-
* @property {number} [autoscaleIntervalSecs=10]
|
|
131
|
-
* Defines in seconds how often the pool should attempt to adjust the desired concurrency
|
|
132
|
-
* based on the latest system status. Setting it lower than 1 might have a severe impact on performance.
|
|
133
|
-
* We suggest using a value from 5 to 20.
|
|
134
|
-
* @property {number} [taskTimeoutSecs=0]
|
|
135
|
-
* Timeout in which the `runTaskFunction` needs to finish, given in seconds.
|
|
136
|
-
* @property {SnapshotterOptions} [snapshotterOptions]
|
|
137
|
-
* Options to be passed down to the {@link Snapshotter} constructor. This is useful for fine-tuning
|
|
138
|
-
* the snapshot intervals and history.
|
|
139
|
-
* @property {SystemStatusOptions} [systemStatusOptions]
|
|
140
|
-
* Options to be passed down to the {@link SystemStatus} constructor. This is useful for fine-tuning
|
|
141
|
-
* the system status reports. If a custom snapshotter is set in the options, it will be used
|
|
142
|
-
* by the pool.
|
|
143
|
-
*/
|
|
144
|
-
/**
|
|
145
|
-
* Manages a pool of asynchronous resource-intensive tasks that are executed in parallel.
|
|
146
|
-
* The pool only starts new tasks if there is enough free CPU and memory available
|
|
147
|
-
* and the Javascript event loop is not blocked.
|
|
148
|
-
*
|
|
149
|
-
* The information about the CPU and memory usage is obtained by the {@link Snapshotter} class,
|
|
150
|
-
* which makes regular snapshots of system resources that may be either local
|
|
151
|
-
* or from the Apify cloud infrastructure in case the process is running on the Apify platform.
|
|
152
|
-
* Meaningful data gathered from these snapshots is provided to `AutoscaledPool` by the {@link SystemStatus} class.
|
|
153
|
-
*
|
|
154
|
-
* Before running the pool, you need to implement the following three functions:
|
|
155
|
-
* {@link AutoscaledPoolOptions#runTaskFunction},
|
|
156
|
-
* {@link AutoscaledPoolOptions#isTaskReadyFunction} and
|
|
157
|
-
* {@link AutoscaledPoolOptions#isFinishedFunction}.
|
|
158
|
-
*
|
|
159
|
-
* The auto-scaled pool is started by calling the {@link AutoscaledPool#run} function.
|
|
160
|
-
* The pool periodically queries the {@link AutoscaledPoolOptions#isTaskReadyFunction} function
|
|
161
|
-
* for more tasks, managing optimal concurrency, until the function resolves to `false`. The pool then queries
|
|
162
|
-
* the {@link AutoscaledPoolOptions#isFinishedFunction}. If it resolves to `true`, the run finishes after all running tasks complete.
|
|
163
|
-
* If it resolves to `false`, it assumes there will be more tasks available later and keeps periodically querying for tasks.
|
|
164
|
-
* If any of the tasks throws then the {@link AutoscaledPool#run} function rejects the promise with an error.
|
|
165
|
-
*
|
|
166
|
-
* The pool evaluates whether it should start a new task every time one of the tasks finishes
|
|
167
|
-
* and also in the interval set by the `options.maybeRunIntervalSecs` parameter.
|
|
168
|
-
*
|
|
169
|
-
* **Example usage:**
|
|
170
|
-
*
|
|
171
|
-
* ```javascript
|
|
172
|
-
* const pool = new Apify.AutoscaledPool({
|
|
173
|
-
* maxConcurrency: 50,
|
|
174
|
-
* runTaskFunction: async () => {
|
|
175
|
-
* // Run some resource-intensive asynchronous operation here.
|
|
176
|
-
* },
|
|
177
|
-
* isTaskReadyFunction: async () => {
|
|
178
|
-
* // Tell the pool whether more tasks are ready to be processed.
|
|
179
|
-
* // Return true or false
|
|
180
|
-
* },
|
|
181
|
-
* isFinishedFunction: async () => {
|
|
182
|
-
* // Tell the pool whether it should finish
|
|
183
|
-
* // or wait for more tasks to become available.
|
|
184
|
-
* // Return true or false
|
|
185
|
-
* }
|
|
186
|
-
* });
|
|
187
|
-
*
|
|
188
|
-
* await pool.run();
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
declare class AutoscaledPool {
|
|
192
|
-
/**
|
|
193
|
-
* @param {AutoscaledPoolOptions} options
|
|
194
|
-
* All `AutoscaledPool` configuration options.
|
|
195
|
-
*/
|
|
196
|
-
constructor(options: AutoscaledPoolOptions);
|
|
197
|
-
/**
|
|
198
|
-
* @type {Log}
|
|
199
|
-
*/
|
|
200
|
-
log: Log;
|
|
201
|
-
desiredConcurrencyRatio: number;
|
|
202
|
-
scaleUpStepRatio: number;
|
|
203
|
-
scaleDownStepRatio: number;
|
|
204
|
-
maybeRunIntervalMillis: number;
|
|
205
|
-
loggingIntervalMillis: number;
|
|
206
|
-
autoscaleIntervalMillis: number;
|
|
207
|
-
taskTimeoutMillis: number;
|
|
208
|
-
runTaskFunction: Function;
|
|
209
|
-
isFinishedFunction: Function;
|
|
210
|
-
isTaskReadyFunction: Function;
|
|
211
|
-
_minConcurrency: number;
|
|
212
|
-
_maxConcurrency: number;
|
|
213
|
-
_desiredConcurrency: number;
|
|
214
|
-
_currentConcurrency: number;
|
|
215
|
-
isStopped: boolean;
|
|
216
|
-
lastLoggingTime: number;
|
|
217
|
-
resolve: ((value: any) => void) | null;
|
|
218
|
-
reject: ((reason?: any) => void) | null;
|
|
219
|
-
/**
|
|
220
|
-
* Gets called every autoScaleIntervalSecs and evaluates the current system status.
|
|
221
|
-
* If the system IS NOT overloaded and the settings allow it, it scales up.
|
|
222
|
-
* If the system IS overloaded and the settings allow it, it scales down.
|
|
223
|
-
*
|
|
224
|
-
* @ignore
|
|
225
|
-
* @protected
|
|
226
|
-
* @internal
|
|
227
|
-
*/
|
|
228
|
-
protected _autoscale(intervalCallback: any): any;
|
|
229
|
-
/**
|
|
230
|
-
* Starts a new task
|
|
231
|
-
* if the number of running tasks (current concurrency) is lower than desired concurrency
|
|
232
|
-
* and the system is not currently overloaded
|
|
233
|
-
* and this.isTaskReadyFunction() returns true.
|
|
234
|
-
*
|
|
235
|
-
* It doesn't allow multiple concurrent runs of this method.
|
|
236
|
-
*
|
|
237
|
-
* @ignore
|
|
238
|
-
* @protected
|
|
239
|
-
* @internal
|
|
240
|
-
*/
|
|
241
|
-
protected _maybeRunTask(intervalCallback: any): Promise<any>;
|
|
242
|
-
snapshotter: Snapshotter;
|
|
243
|
-
systemStatus: SystemStatus;
|
|
244
|
-
/**
|
|
245
|
-
* Sets the minimum number of tasks running in parallel.
|
|
246
|
-
*
|
|
247
|
-
* *WARNING:* If you set this value too high with respect to the available system memory and CPU, your code might run extremely slow or crash.
|
|
248
|
-
* If you're not sure, just keep the default value and the concurrency will scale up automatically.
|
|
249
|
-
*
|
|
250
|
-
* @param {number} value
|
|
251
|
-
*/
|
|
252
|
-
set minConcurrency(arg: number);
|
|
253
|
-
/**
|
|
254
|
-
* Gets the minimum number of tasks running in parallel.
|
|
255
|
-
*
|
|
256
|
-
* @return {number}
|
|
257
|
-
*/
|
|
258
|
-
get minConcurrency(): number;
|
|
259
|
-
/**
|
|
260
|
-
* Sets the maximum number of tasks running in parallel.
|
|
261
|
-
*
|
|
262
|
-
* @param {number} value
|
|
263
|
-
*/
|
|
264
|
-
set maxConcurrency(arg: number);
|
|
265
|
-
/**
|
|
266
|
-
* Gets the maximum number of tasks running in parallel.
|
|
267
|
-
*
|
|
268
|
-
* @return {number}
|
|
269
|
-
*/
|
|
270
|
-
get maxConcurrency(): number;
|
|
271
|
-
/**
|
|
272
|
-
* Sets the desired concurrency for the pool, i.e. the number of tasks that should be running
|
|
273
|
-
* in parallel if there's large enough supply of tasks.
|
|
274
|
-
*
|
|
275
|
-
* @param {number} value
|
|
276
|
-
*/
|
|
277
|
-
set desiredConcurrency(arg: number);
|
|
278
|
-
/**
|
|
279
|
-
* Gets the desired concurrency for the pool,
|
|
280
|
-
* which is an estimated number of parallel tasks that the system can currently support.
|
|
281
|
-
*
|
|
282
|
-
* @return {number}
|
|
283
|
-
*/
|
|
284
|
-
get desiredConcurrency(): number;
|
|
285
|
-
/**
|
|
286
|
-
* Gets the the number of parallel tasks currently running in the pool.
|
|
287
|
-
*
|
|
288
|
-
* @return {number}
|
|
289
|
-
*/
|
|
290
|
-
get currentConcurrency(): number;
|
|
291
|
-
/**
|
|
292
|
-
* Runs the auto-scaled pool. Returns a promise that gets resolved or rejected once
|
|
293
|
-
* all the tasks are finished or one of them fails.
|
|
294
|
-
*
|
|
295
|
-
* @return {Promise<void>}
|
|
296
|
-
*/
|
|
297
|
-
run(): Promise<void>;
|
|
298
|
-
poolPromise: Promise<any> | undefined;
|
|
299
|
-
autoscaleInterval: import("@apify/utilities").BetterIntervalID | undefined;
|
|
300
|
-
maybeRunInterval: import("@apify/utilities").BetterIntervalID | undefined;
|
|
301
|
-
/**
|
|
302
|
-
* Aborts the run of the auto-scaled pool and destroys it. The promise returned from
|
|
303
|
-
* the {@link AutoscaledPool#run} function will immediately resolve, no more new tasks
|
|
304
|
-
* will be spawned and all running tasks will be left in their current state.
|
|
305
|
-
*
|
|
306
|
-
* Due to the nature of the tasks, auto-scaled pool cannot reliably guarantee abortion
|
|
307
|
-
* of all the running tasks, therefore, no abortion is attempted and some of the tasks
|
|
308
|
-
* may finish, while others may not. Essentially, auto-scaled pool doesn't care about
|
|
309
|
-
* their state after the invocation of `.abort()`, but that does not mean that some
|
|
310
|
-
* parts of their asynchronous chains of commands will not execute.
|
|
311
|
-
*
|
|
312
|
-
* @return {Promise<void>}
|
|
313
|
-
*/
|
|
314
|
-
abort(): Promise<void>;
|
|
315
|
-
/**
|
|
316
|
-
* Prevents the auto-scaled pool from starting new tasks, but allows the running ones to finish
|
|
317
|
-
* (unlike abort, which terminates them). Used together with {@link AutoscaledPool#resume}
|
|
318
|
-
*
|
|
319
|
-
* The function's promise will resolve once all running tasks have completed and the pool
|
|
320
|
-
* is effectively idle. If the `timeoutSecs` argument is provided, the promise will reject
|
|
321
|
-
* with a timeout error after the `timeoutSecs` seconds.
|
|
322
|
-
*
|
|
323
|
-
* The promise returned from the {@link AutoscaledPool#run} function will not resolve
|
|
324
|
-
* when `.pause()` is invoked (unlike abort, which resolves it).
|
|
325
|
-
*
|
|
326
|
-
* @param {number} [timeoutSecs]
|
|
327
|
-
* @return {Promise<void>}
|
|
328
|
-
*/
|
|
329
|
-
pause(timeoutSecs?: number | undefined): Promise<void>;
|
|
330
|
-
/**
|
|
331
|
-
* Resumes the operation of the autoscaled-pool by allowing more tasks to be run.
|
|
332
|
-
* Used together with {@link AutoscaledPool#pause}
|
|
333
|
-
*
|
|
334
|
-
* Tasks will automatically start running again in `options.maybeRunIntervalSecs`.
|
|
335
|
-
*/
|
|
336
|
-
resume(): void;
|
|
337
|
-
queryingIsTaskReady: boolean | undefined;
|
|
338
|
-
/**
|
|
339
|
-
* Scales the pool up by increasing
|
|
340
|
-
* the desired concurrency by the scaleUpStepRatio.
|
|
341
|
-
*
|
|
342
|
-
* @param {Object} systemStatus for logging
|
|
343
|
-
* @ignore
|
|
344
|
-
* @protected
|
|
345
|
-
* @internal
|
|
346
|
-
*/
|
|
347
|
-
protected _scaleUp(systemStatus: Object): void;
|
|
348
|
-
/**
|
|
349
|
-
* Scales the pool down by decreasing
|
|
350
|
-
* the desired concurrency by the scaleDownStepRatio.
|
|
351
|
-
*
|
|
352
|
-
* @param {Object} systemStatus for logging
|
|
353
|
-
* @ignore
|
|
354
|
-
* @protected
|
|
355
|
-
* @internal
|
|
356
|
-
*/
|
|
357
|
-
protected _scaleDown(systemStatus: Object): void;
|
|
358
|
-
/**
|
|
359
|
-
* If there are no running tasks and this.isFinishedFunction() returns true then closes
|
|
360
|
-
* the pool and resolves the pool's promise returned by the run() method.
|
|
361
|
-
*
|
|
362
|
-
* It doesn't allow multiple concurrent runs of this method.
|
|
363
|
-
*
|
|
364
|
-
* @ignore
|
|
365
|
-
* @protected
|
|
366
|
-
* @internal
|
|
367
|
-
*/
|
|
368
|
-
protected _maybeFinish(): Promise<void>;
|
|
369
|
-
queryingIsFinished: boolean | undefined;
|
|
370
|
-
/**
|
|
371
|
-
* Cleans up resources.
|
|
372
|
-
*
|
|
373
|
-
* @ignore
|
|
374
|
-
* @protected
|
|
375
|
-
* @internal
|
|
376
|
-
*/
|
|
377
|
-
protected _destroy(): Promise<void>;
|
|
378
|
-
}
|
|
379
|
-
import { SnapshotterOptions } from "./snapshotter";
|
|
380
|
-
import { SystemStatusOptions } from "./system_status";
|
|
381
|
-
import { Log } from "../utils_log";
|
|
382
|
-
import Snapshotter from "./snapshotter";
|
|
383
|
-
import SystemStatus from "./system_status";
|
|
384
|
-
//# sourceMappingURL=autoscaled_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