Skip to content

Instantly share code, notes, and snippets.

@amitsaha
Created August 22, 2012 08:43
Show Gist options
  • Select an option

  • Save amitsaha/3423822 to your computer and use it in GitHub Desktop.

Select an option

Save amitsaha/3423822 to your computer and use it in GitHub Desktop.
PiCloud to concurrent.futures API mapping
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