Mercurial > public > mercurial-scm > hg-stable
diff tests/test-batching.py @ 47914:c424ff4807e6
wireprotov1peer: update all rpcs to use the new batchable scheme
If desired, we could keep the future class and the function that
upgrades an old style rpc instead of a new style, for extensions.
Differential Revision: https://phab.mercurial-scm.org/D11212
author | Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> |
---|---|
date | Tue, 24 Aug 2021 17:27:16 +0200 |
parents | 05dd091dfa6a |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/tests/test-batching.py Tue Aug 24 17:27:16 2021 +0200 +++ b/tests/test-batching.py Tue Aug 24 17:27:16 2021 +0200 @@ -214,14 +214,11 @@ mangle(two), ), ] - encoded_res_future = wireprotov1peer.future() - yield encoded_args, encoded_res_future - yield unmangle(encoded_res_future.value) + return encoded_args, unmangle @wireprotov1peer.batchable def bar(self, b, a): - encresref = wireprotov1peer.future() - yield [ + return [ ( b'b', mangle(b), @@ -230,8 +227,7 @@ b'a', mangle(a), ), - ], encresref - yield unmangle(encresref.value) + ], unmangle # greet is coded directly. It therefore does not support batching. If it # does appear in a batch, the batch is split around greet, and the call to