Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15378598
D11269.id27074.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11269.id27074.diff
View Options
diff --git a/src/docs/article/using_futures.diviner b/src/docs/article/using_futures.diviner
--- a/src/docs/article/using_futures.diviner
+++ b/src/docs/article/using_futures.diviner
@@ -58,14 +58,13 @@
Commonly, you may have many similar tasks you wish to parallelize: instead of
compressing one file, you want to compress several files. You can use the
-@{class:FutureIterator} class to manage multiple futures, via the convenience
-function @{function:Futures}.
+@{class:FutureIterator} class to manage multiple futures.
$futures = array();
foreach ($files as $file) {
$futures[$file] = new ExecFuture("gzip %s", $file);
}
- foreach (Futures($futures) as $file => $future) {
+ foreach (new FutureIterator($futures) as $file => $future) {
list($err, $stdout, $stderr) = $future->resolve();
if (!$err) {
echo "Compressed {$file}...\n";
@@ -74,7 +73,7 @@
}
}
-@{function:Futures} takes a list of futures and runs them in parallel,
+@{class:FutureIterator} takes a list of futures and runs them in parallel,
**returning them in the order they resolve, NOT the original list order**. This
allows your program to begin any followup computation as quickly as possible: if
the slowest future in the list happens to be the first one, you can finish
@@ -83,7 +82,7 @@
You can also limit how many futures you want to run at once. For instance, to
process no more than 4 files simultaneously:
- foreach (Futures($futures)->limit(4) as $file => $future) {
+ foreach (id(new FutureIterator($futures))->limit(4) as $file => $future) {
// ...
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 14, 3:40 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7573367
Default Alt Text
D11269.id27074.diff (1 KB)
Attached To
Mode
D11269: Remove references to `Futures()` from the documentation
Attached
Detach File
Event Timeline
Log In to Comment