[PATCH RFC] batching: new module to support batching of commands

Augie Fackler lists at durin42.com
Thu Jun 2 13:12:32 CDT 2011


On Thu, Jun 2, 2011 at 11:59 AM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2011-06-02 at 18:18 +0200, Peter Arrenbrecht wrote:
>> # HG changeset patch
>> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
>> # Date 1307031409 -7200
>> # Node ID 9946e78354feb1651953dfd65009a005fb0d3dd9
>> # Parent  1ffeeb91c55d0b00445ceabde14a0d0faf906a33
>> batching: new module to support batching of commands
>
> Let's give it a different name to make it clear it's attached to the
> wire protocol.
>
> Remind me why we need this with the new discovery protocol?
>
>> +class batch:
>
> Inherit from object. We should probably make check-code complain about
> using old-style classes.

In 2.7:

>>> class foo:
...  pass
...
>>> isinstance(foo(), object)
True

ISTR this changed a while ago, perhaps as long ago as 2.4, but I can't
find the doc right now and don't have 2.4 handy to test.

>
>> +class localbatch(batch):
>> +    def __init__(self, local):
>> +        batch.__init__(self)
>> +        self.local = local
>> +    def submit(self):
>> +        for name, args, opts, resref in self.calls:
>> +            resref.append(getattr(self.local, name)(*args, **opts))
>
> Is there any point batching local operations? Shouldn't they just be
> fulfilled immediately and have submit do nothing?
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list