Created
August 22, 2012 08:43
-
-
Save amitsaha/3423822 to your computer and use it in GitHub Desktop.
PiCloud to concurrent.futures API mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from concurrent.futures import _base | |
| import cloud | |
| class PiCloudExecutor(_base.Executor): | |
| def __init__(self, max_workers): | |
| """Initializes a new PiCloudExecutor instance.""" | |
| pass | |
| def submit(self, fn, *args, **kwargs): | |
| f = _base.Future() | |
| # make the call to the cloud | |
| jid = cloud.call(fn,*args,**kwargs) | |
| return f | |
| submit.__doc__ = _base.Executor.submit.__doc__ | |
| def map(self, fn, *iterables): | |
| # will call cloud.map() | |
| pass | |
| def shutdown(self, wait=True): | |
| pass | |
| shutdown.__doc__ = _base.Executor.shutdown.__doc__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment