comparison mercurial/wireproto.py @ 33765:e2fc2122029c

wireproto: remove support for local results in @batchable (API) @peer.batchable decorated generator functions have two forms: yield value, None and yield args, future yield value These forms have been present since the decorator was introduced. There are currently no in-repo consumers of the first form. So this commit removes support for it. Note that remoteiterbatcher.submit() asserts the 2nd form. And b6e71f8af5b8 removed the last user of remotebatcher, forcing everyone to remoteiterbatcher. So anything relying on this in the wild would have been broken since b6e71f8af5b8. .. api:: @peer.batchable can no longer emit local values Differential Revision: https://phab.mercurial-scm.org/D318
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 09 Aug 2017 22:52:05 -0700
parents 297d1b70685c
children 4c706037adef
comparison
equal deleted inserted replaced
33764:297d1b70685c 33765:e2fc2122029c
93 mtd = getattr(self.remote, name) 93 mtd = getattr(self.remote, name)
94 batchablefn = getattr(mtd, 'batchable', None) 94 batchablefn = getattr(mtd, 'batchable', None)
95 if batchablefn is not None: 95 if batchablefn is not None:
96 batchable = batchablefn(mtd.im_self, *args, **opts) 96 batchable = batchablefn(mtd.im_self, *args, **opts)
97 encargsorres, encresref = next(batchable) 97 encargsorres, encresref = next(batchable)
98 if encresref: 98 assert encresref
99 req.append((name, encargsorres,)) 99 req.append((name, encargsorres,))
100 rsp.append((batchable, encresref, resref,)) 100 rsp.append((batchable, encresref, resref,))
101 else:
102 resref.set(encargsorres)
103 else: 101 else:
104 if req: 102 if req:
105 self._submitreq(req, rsp) 103 self._submitreq(req, rsp)
106 req, rsp = [], [] 104 req, rsp = [], []
107 resref.set(mtd(*args, **opts)) 105 resref.set(mtd(*args, **opts))