[rfc] developer documentation on user interaction
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 25 16:03:47 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vincent Ladeuil wrote:
>>>>>> "Gary" == Gary van der Merwe <garyvdm at gmail.com> writes:
>
> Gary> This seems to be quite an emotional discussion.... (/me treads carefully)
>
> Sometimes things have to be said :-D
>
> <snip/>
>
> Gary> No - I don't think that api stability was the reason
> Gary> why we (luks) chose the subprocess design. The reason
> Gary> why it was chosen was for maintaining ui interaction.
>
> Nothing wrong with that, the problem is not trivial anyway.
>
> Gary> I personally feel that a single process, 2 threads, one
> Gary> for ui, one for bzrlib, and some way for them to talk
> Gary> (probably using qt event signals) would be much
> Gary> better.
>
> I'm pretty sure GTK provides ways for processes to exchange
> events, I'd be surprised if qbzr couldn't do the same.
>
> Otherwise, you'll have to serialize/deserialize them in the
> pipes, since you're dealing with the same code on both sides, you
> shouldn't encounter nasty problems there.
>
So interestingly, python2.6 provides a 'multiprocessing' module in the
standard lib, which is roughly equivalent to 'threading'.
In that you can say "multiprocessing.Process(python_func, *args)" and it
will spawn a subprocess that calls python_func with appropriate
arguments. It basically uses cPickle to marshal and unmarshal python
objects across the barrier.
I *don't* know how well it works with interactivity, or getting
progressive updates (can python_func be a generator rather than a plain
function? etc)
I would certainly consider switching the windows installers to python2.6
for 2.1.0b1 and if it goes well, we could do the same for 2.0.1 or
whatever version comes out at a reasonable time.
I realize qbzr may want to keep backwards compatibility with python 2.4,
which is what bzrlib itself works to support. But it is an idea.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkq829MACgkQJdeBCYSNAAOo7wCeIPtuKZkLQkav+LmIcxYUiSSv
TjYAnikb/uRVbtR5tfKceiN/fMyqAvfl
=17Co
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list