[PATCH 1 of 4] wireproto: add basic command batching infrastructure

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Thu Jun 16 09:34:39 CDT 2011


On Thu, Jun 16, 2011 at 4:21 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Thu, 16 Jun 2011 14:20:57 +0200
> Peter Arrenbrecht <peter.arrenbrecht at gmail.com> wrote:
>>
>> > i'm not a fan of 'future', is it an object? i can't tell from this.
>>
>> It's a fairly established term for a thing that you get back from a
>> call immediately with the promise that, when you access the thing's
>> value later, it will hold the actual result of the call. So it's
>> sometimes called a 'promise', too.
>
> For the record, if you need a futures API in Python, you may want to
> take a look at the new concurrent.futures module:
> http://docs.python.org/dev/library/concurrent.futures.html#future-objects

Thanks, I saw that. Thing is, we only need a very light-weight version
here. Maybe I should just have called it resultref or something like
that, since we actually rely on batch.submit() to trigger the filling
in of results (in my first version it was just an empty list I later
appended to).

It would be closer to how other 'future's behave if future.value()
implicitly triggered batch.submit() behind the scenes (which we could,
of course, implement instead of or on top of the current machinery).

-parren


More information about the Mercurial-devel mailing list