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

Unified Diff: async_push.py

Issue 102703004: Improved user-facing messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Moved resource string to PendingManager ctor Created 6 years, 11 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
« no previous file with comments | « no previous file | pending_manager.py » ('j') | tests/pending_manager_test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: async_push.py
diff --git a/async_push.py b/async_push.py
index 7571d0cb4c40e16c011730fac12611d77bf1f10a..9908da939f81b9126aeb4cbe67e66de2df310420 100644
--- a/async_push.py
+++ b/async_push.py
@@ -59,17 +59,18 @@ class AsyncPushStore(AsyncPushNoop):
class AsyncPush(AsyncPushNoop):
- """Sends HTTP Post in a background worker thread.
+ """Sends HTTP Post asynchronously to the tree status application.
- Thread-safe.
+ This object uses a background worker thread, and is thread-safe.
"""
_TERMINATE = object()
- def __init__(self, url, password):
+ def __init__(self, url, password, resource='/receiver'):
super(AsyncPush, self).__init__()
assert url
assert password
self.url = url
+ self.resource = resource
self.password = password
self.queue = Queue.Queue()
self.thread = threading.Thread(target=self._worker_thread)
@@ -111,7 +112,7 @@ class AsyncPush(AsyncPushNoop):
done = True
logging.debug('Worker thread exiting')
items.remove(self._TERMINATE)
- url = self.url + '/receiver'
+ url = self.url + self.resource
logging.debug('Sending %d items to %s' % (len(items), url))
try:
data = [('p', json.dumps(item)) for item in items]
« no previous file with comments | « no previous file | pending_manager.py » ('j') | tests/pending_manager_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698