Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7134)

Unified Diff: chrome/common/extensions/docs/server2/future.py

Issue 151773002: Docserver: Properly implement the Cron logic for ContentProvider and TemplateDataSource so that the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoz + rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/future.py
diff --git a/chrome/common/extensions/docs/server2/future.py b/chrome/common/extensions/docs/server2/future.py
index 0e9ef24317d36464cb237387d8cdc1be824d97be..a211ec14ed4ca610edf860f6f83de5265ca685d1 100644
--- a/chrome/common/extensions/docs/server2/future.py
+++ b/chrome/common/extensions/docs/server2/future.py
@@ -7,6 +7,13 @@ import sys
_no_value = object()
+def Collect(futures):
+ '''Creates a Future which returns a list of results from each Future in
+ |future|.
Yoyo Zhou 2014/02/04 21:42:13 futures
not at google - send to devlin 2014/02/04 21:57:13 Done.
+ '''
+ return Future(delegate=Gettable(lambda: [f.Get() for f in futures]))
+
+
class Gettable(object):
'''Allows a Future to accept a callable as a delegate. Wraps |f| in a .Get
interface required by Future.

Powered by Google App Engine
This is Rietveld 408576698