Mercurial > hg
view tests/test-propertycache.py.out @ 33766:4c706037adef
wireproto: overhaul iterating batcher code (API)
The remote batching code is difficult to read. Let's improve it.
As part of the refactor, the future returned by method calls on
batchiter() instances is now populated. However, you still need to
consume the results() generator for the future to be set. But at
least now we can stuff the future somewhere and not have to worry
about aligning method call order with result order since you can
use a future to hold the result.
Also as part of the change, we now verify that @batchable generators
yield exactly 2 values. In other words, we enforce their API.
The non-iter batcher has been unused since b6e71f8af5b8. And to my
surprise we had no explicit unit test coverage of it! test-batching.py
has been overhauled to use the iterating batcher.
Since the iterating batcher doesn't allow non-batchable method
calls nor local calls, tests have been updated to reflect reality.
The iterating batcher has been used for multiple releases apparently
without major issue. So this shouldn't cause alarm.
.. api::
@peer.batchable functions must now yield exactly 2 values
Differential Revision: https://phab.mercurial-scm.org/D319
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 09 Aug 2017 23:29:30 -0700 |
parents | 9789670992d6 |
children |
line wrap: on
line source
=== property cache === calllog: [] cached value (unfiltered): NOCACHE = first access on unfiltered, should do a call access: 0 calllog: [0] cached value (unfiltered): 0 = second access on unfiltered, should not do call access 0 calllog: [0] cached value (unfiltered): 0 = first access on "visible" view, should do a call cached value ("visible" view): NOCACHE access: 7 calllog: [0, 7] cached value (unfiltered): 0 cached value ("visible" view): 7 = second access on "visible view", should not do call access: 7 calllog: [0, 7] cached value (unfiltered): 0 cached value ("visible" view): 7 = no effect on other view cached value ("immutable" view): NOCACHE access: 9 calllog: [0, 7, 9] cached value (unfiltered): 0 cached value ("visible" view): 7 cached value ("immutable" view): 9 === unfiltered property cache === unficalllog: [] cached value (unfiltered): NOCACHE cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE = first access on unfiltered, should do a call access (unfiltered): 100 unficalllog: [100] cached value (unfiltered): 100 = second access on unfiltered, should not do call access (unfiltered): 100 unficalllog: [100] cached value (unfiltered): 100 = access on view should use the unfiltered cache access (unfiltered): 100 access ("visible" view): 100 access ("immutable" view): 100 unficalllog: [100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE = even if we clear the unfiltered cache cached value (unfiltered): NOCACHE cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE unficalllog: [100] access ("visible" view): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE access ("immutable" view): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE access (unfiltered): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE