Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13994115
D11079.id26595.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Referenced Files
None
Subscribers
None
D11079.id26595.diff
View Options
diff --git a/src/lint/linter/ArcanistCSharpLinter.php b/src/lint/linter/ArcanistCSharpLinter.php
--- a/src/lint/linter/ArcanistCSharpLinter.php
+++ b/src/lint/linter/ArcanistCSharpLinter.php
@@ -184,7 +184,9 @@
public function didRunLinters() {
if ($this->futures) {
- foreach (Futures($this->futures)->limit(8) as $future) {
+ $futures = id(new FutureIterator($this->futures))
+ ->limit(8);
+ foreach ($futures as $future) {
$this->resolveFuture($future);
}
}
diff --git a/src/lint/linter/ArcanistFutureLinter.php b/src/lint/linter/ArcanistFutureLinter.php
--- a/src/lint/linter/ArcanistFutureLinter.php
+++ b/src/lint/linter/ArcanistFutureLinter.php
@@ -13,7 +13,7 @@
final public function willLintPaths(array $paths) {
$limit = $this->getFuturesLimit();
- $this->futures = Futures(array())->limit($limit);
+ $this->futures = id(new FutureIterator(array()))->limit($limit);
foreach ($this->buildFutures($paths) as $path => $future) {
$this->futures->addFuture($future, $path);
}
diff --git a/src/lint/linter/ArcanistScriptAndRegexLinter.php b/src/lint/linter/ArcanistScriptAndRegexLinter.php
--- a/src/lint/linter/ArcanistScriptAndRegexLinter.php
+++ b/src/lint/linter/ArcanistScriptAndRegexLinter.php
@@ -187,7 +187,9 @@
$futures[$path] = $future;
}
- foreach (Futures($futures)->limit(4) as $path => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(4);
+ foreach ($futures as $path => $future) {
list($stdout) = $future->resolvex();
$this->output[$path] = $stdout;
}
diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php
--- a/src/repository/api/ArcanistGitAPI.php
+++ b/src/repository/api/ArcanistGitAPI.php
@@ -609,7 +609,7 @@
// After the other commands exit, we can start the `diff-files` command.
);
- Futures($futures)->resolveAll();
+ id(new FutureIterator($futures))->resolveAll();
// We're clear to start the `git diff-files` now.
$unstaged_future->start();
diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php
--- a/src/repository/api/ArcanistMercurialAPI.php
+++ b/src/repository/api/ArcanistMercurialAPI.php
@@ -284,7 +284,9 @@
$last_node = $node;
}
- foreach (Futures($futures)->limit(4) as $node => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(4);
+ foreach ($futures as $node => $future) {
list($parents) = $future->resolvex();
$parents = array_filter(explode("\n", $parents));
$commits[$node]['parents'] = $parents;
diff --git a/src/unit/engine/NoseTestEngine.php b/src/unit/engine/NoseTestEngine.php
--- a/src/unit/engine/NoseTestEngine.php
+++ b/src/unit/engine/NoseTestEngine.php
@@ -59,7 +59,9 @@
}
$results = array();
- foreach (Futures($futures)->limit(4) as $test_path => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(4);
+ foreach ($futures as $test_path => $future) {
try {
list($stdout, $stderr) = $future->resolvex();
} catch(CommandException $exc) {
diff --git a/src/unit/engine/PhpunitTestEngine.php b/src/unit/engine/PhpunitTestEngine.php
--- a/src/unit/engine/PhpunitTestEngine.php
+++ b/src/unit/engine/PhpunitTestEngine.php
@@ -73,7 +73,9 @@
}
$results = array();
- foreach (Futures($futures)->limit(4) as $test => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(4);
+ foreach ($futures as $test => $future) {
list($err, $stdout, $stderr) = $future->resolve();
diff --git a/src/unit/engine/XUnitTestEngine.php b/src/unit/engine/XUnitTestEngine.php
--- a/src/unit/engine/XUnitTestEngine.php
+++ b/src/unit/engine/XUnitTestEngine.php
@@ -277,7 +277,7 @@
dirname($test_assembly['project'])));
$build_futures[$test_assembly['project']] = $build_future;
}
- $iterator = Futures($build_futures)->limit(1);
+ $iterator = id(new FutureIterator($build_futures))->limit(1);
foreach ($iterator as $test_assembly => $future) {
$result = new ArcanistUnitTestResult();
$result->setName('(build) '.$test_assembly);
@@ -353,7 +353,9 @@
}
// Run all of the tests.
- foreach (Futures($futures)->limit(8) as $test_assembly => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(8);
+ foreach ($futures as $test_assembly => $future) {
list($err, $stdout, $stderr) = $future->resolve();
if (file_exists($outputs[$test_assembly])) {
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -1135,7 +1135,9 @@
$targets[] = array('command' => 'info', 'path' => $path);
}
- foreach (Futures($futures)->limit(8) as $key => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(8);
+ foreach ($futures as $key => $future) {
$target = $targets[$key];
if ($target['command'] == 'diff') {
$repository_api->primeSVNDiffResult(
@@ -1774,7 +1776,7 @@
));
}
- foreach (Futures($futures) as $key => $future) {
+ foreach (new FutureIterator($futures) as $key => $future) {
$result = $future->resolve();
switch ($key) {
case 'revision':
@@ -2393,7 +2395,8 @@
* @task diffprop
*/
private function resolveDiffPropertyUpdates() {
- Futures($this->diffPropertyFutures)->resolveAll();
+ id(new FutureIterator($this->diffPropertyFutures))
+ ->resolveAll();
$this->diffPropertyFutures = array();
}
@@ -2522,7 +2525,9 @@
));
}
- foreach (Futures($hash_futures)->limit(8) as $key => $future) {
+ $futures = id(new FutureIterator($hash_futures))
+ ->limit(8);
+ foreach ($futures as $key => $future) {
$type = $need_upload[$key]['type'];
$change = $need_upload[$key]['change'];
$name = $need_upload[$key]['name'];
@@ -2553,7 +2558,9 @@
));
}
- foreach (Futures($upload_futures)->limit(4) as $key => $future) {
+ $futures = id(new FutureIterator($upload_futures))
+ ->limit(4);
+ foreach ($futures as $key => $future) {
$type = $need_upload[$key]['type'];
$change = $need_upload[$key]['change'];
$name = $need_upload[$key]['name'];
diff --git a/src/workflow/ArcanistFeatureWorkflow.php b/src/workflow/ArcanistFeatureWorkflow.php
--- a/src/workflow/ArcanistFeatureWorkflow.php
+++ b/src/workflow/ArcanistFeatureWorkflow.php
@@ -191,7 +191,9 @@
$branches = ipull($branches, null, 'name');
- foreach (Futures($futures)->limit(16) as $name => $future) {
+ $futures = id(new FutureIterator($futures))
+ ->limit(16);
+ foreach ($futures as $name => $future) {
list($info) = $future->resolvex();
list($hash, $epoch, $tree, $desc, $text) = explode("\1", trim($info), 5);
@@ -250,7 +252,7 @@
}
$results = array();
- foreach (Futures($calls) as $call) {
+ foreach (new FutureIterator($calls) as $call) {
$results[] = $call->resolve();
}
diff --git a/src/workflow/ArcanistGitHookPreReceiveWorkflow.php b/src/workflow/ArcanistGitHookPreReceiveWorkflow.php
--- a/src/workflow/ArcanistGitHookPreReceiveWorkflow.php
+++ b/src/workflow/ArcanistGitHookPreReceiveWorkflow.php
@@ -113,7 +113,8 @@
));
}
- Futures($futures)->resolveAll();
+ id(new FutureIterator($futures))
+ ->resolveAll();
return 0;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 24, 3:57 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722785
Default Alt Text
D11079.id26595.diff (7 KB)
Attached To
Mode
D11079: Use `new FutureIterator` instead of `Futures`
Attached
Detach File
Event Timeline
Log In to Comment