msg84302 - (view) |
Author: (lekma) * |
Date: 2009-03-28 11:16 |
It would be useful to have the ability to run arbitrary code before a manager's server subprocess is started (I'd use this feature to install signal handlers for example). |
|
|
msg84303 - (view) |
Author: (lekma) * |
Date: 2009-03-28 11:22 |
here is a patch doing just that (against trunk). ps: this is my first bug report and contribution to Python, please, be gentle :) |
|
|
msg84330 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-03-28 19:41 |
Note that the Multiprocessing docs say that the Process "follows the API of threading.Thread," and this would represent a (minor) divergence. I also note that the patch does not contain any tests. |
|
|
msg84368 - (view) |
Author: (lekma) * |
Date: 2009-03-29 08:55 |
AFAIK there is no equivalent to the managers api in threading. As for the tests, what kind of tests would you like to see? Jesse, some thoughts on that? |
|
|
msg84404 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-03-29 14:21 |
Right, it's just the Thread/Process API equivalance. I'm not saying it's a stopper, but the docs would probably need to be modified accordingly. As for tests, even just one that would prove that the method will be called and do something trivial would be a good thing to have, IMO. |
|
|
msg84406 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-03-29 14:32 |
By the way, in case it isn't clear, I defer to Jesse on whether or not it makes sense to accept this :) |
|
|
msg84409 - (view) |
Author: Jesse Noller (jnoller) *  |
Date: 2009-03-29 14:33 |
I know, but tests (like the ones you outlined) would also make it more compelling |
|
|
msg84609 - (view) |
Author: (lekma) * |
Date: 2009-03-30 18:43 |
> Right, it's just the Thread/Process API equivalance. I'm not saying > it's a stopper, but the docs would probably need to be modified > accordingly. I'm a bit confused here. The patch only adds a small feature to BaseManager and subtypes (the same way Pool does it already). AFAICT the Thread/Process API equivalence is preserved. Am I missing something? This patch should be better: - checks that initializer is a callable, raise TypeError if not (do it for Pool.__init__ also). - adds tests for Pool.__init__ and SyncManager.start |
|
|
msg84754 - (view) |
Author: (lekma) * |
Date: 2009-03-31 07:12 |
The same against py3k. Jesse, is there any chance that this will make it in, or should I just go and implement a local solution? |
|
|
msg84768 - (view) |
Author: Jesse Noller (jnoller) *  |
Date: 2009-03-31 12:37 |
On Mar 31, 2009, at 2:12 AM, lekma <report@bugs.python.org> wrote: > > lekma <lekmalek@gmail.com> added the comment: > > The same against py3k. > > Jesse, is there any chance that this will make it in, or should I just > go and implement a local solution? > I'm thinking about it and plan on discussing it with other core devs today. Altering the Api is not something done lightly |
|
|
msg84776 - (view) |
Author: (lekma) * |
Date: 2009-03-31 13:21 |
> I'm thinking about it and plan on discussing it with other core devs > today. Altering the Api is not something done lightly yep. Thanks for considering it. |
|
|
msg84778 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2009-03-31 13:35 |
>I'm a bit confused here. The patch only adds a small feature to >BaseManager and subtypes (the same way Pool does it already). AFAICT the >Thread/Process API equivalence is preserved. Am I missing something? No, I'm the one who was missing something. I obviously didn't look at the patch carefully enough. |
|
|
msg85165 - (view) |
Author: Jesse Noller (jnoller) *  |
Date: 2009-04-02 05:18 |
committed in r71041 on python trunk, provided clean buildbots, we will merge to python 3.1 |
|
|
msg85174 - (view) |
Author: (lekma) * |
Date: 2009-04-02 06:34 |
thanks guys |
|
|