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

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: 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..4a903440aed592d9fc81104cc0fd60fdbe0daa49 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
+ |futures|.
+ '''
+ 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.
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698