startover / pythonfutures

Automatically exported from code.google.com/p/pythonfutures
Other
0 stars 0 forks source link

API Change #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is an API Change that changes the current Executor to ExecutorBase and 
adds a new Executor class that is used like

futures.Executor() # creates an executor that uses threading and a 
max_workers = to the number of cpus

futures.Executor(use='process') # Creates an executor that uses 
multiprocessing and a max_workers = to the number of cpus

futures.Executor(max_workers=5) # threading again, just specifying the 
number of workers

futures.Executor(use='process', max_workers=5) # back to multiprocessing, 
but with the max_workers specified

This also includes a patch to fix the examples so they run on windows (it 
relies on the api_change.diff)

Original issue reported on code.google.com by digitalx...@gmail.com on 7 Mar 2010 at 3:06

GoogleCodeExporter commented 9 years ago
So after talking to Nick Coghlan & Jesse Noller on the mailing list it has been 
determined the first API change was ill-designed so I started over from scratch.

This new design creates a singleton registration/tracking class. This new 
singleton 
class allows several things
1) Removal of all the global scoped tracking/cleanup code that was required for 
each 
executor
2) 3rd parties can register their own executor with the system
3) a Factory is used to create new executors based on their registered name.

The registration/factory system is NOT required to be used, it is there for 
convenience, but the tracking/cleanup functionality of the new class is 
required to 
be used within an executor itself. This ensures all executors are tracked and 
cleanup 
to prevent memory leaks.

On the mailing list both Jean-Paul & Antoine Pitrou are +1 for the idea, but 
have not 
looked at the patch yet

Original comment by digitalx...@gmail.com on 9 Mar 2010 at 9:27

Attachments:

GoogleCodeExporter commented 9 years ago
I'm looking at the patch now but it will take me a while.

Original comment by brian.qu...@gmail.com on 19 Mar 2010 at 10:39

GoogleCodeExporter commented 9 years ago
Hi,

I'm incorporated the windows fixes (thanks!) but I don't agree with the 
registration API changes.

Cheers,
Brian

Original comment by Dublin...@gmail.com on 21 May 2010 at 1:22

GoogleCodeExporter commented 9 years ago

Original comment by brian.qu...@gmail.com on 14 Nov 2010 at 3:49