| 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]
|
|
|