From: Brian Warner Date: Sun, 3 Dec 2006 07:53:38 +0000 (-0700) Subject: encode: delay completion until all our messages have been delivered X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~483 X-Git-Url: https://git.rkrishnan.org/vdrive/%22news.html/simplejson/encoder.py.html?a=commitdiff_plain;h=1ba241e07159ee956f9d04bbdc450f42484110c1;p=tahoe-lafs%2Ftahoe-lafs.git encode: delay completion until all our messages have been delivered --- diff --git a/allmydata/encode.py b/allmydata/encode.py index 946db1e0..a9b3d475 100644 --- a/allmydata/encode.py +++ b/allmydata/encode.py @@ -7,9 +7,10 @@ class Encoder(object): self.m = m def do_upload(self, landlords): + dl = [] data = self.infile.read() for (peerid, bucket_num, remotebucket) in landlords: - remotebucket.callRemote('write', data) - remotebucket.callRemote('finalise') + dl.append(remotebucket.callRemote('write', data)) + dl.append(remotebucket.callRemote('close')) - return defer.succeed() + return defer.DeferredList(dl)