Exemplo n.º 1
0
    def __call__(self, *args, **kwargs):
        r = get_connection()
        key = self._key(args, kwargs)
        pickled_entry = r.get(key)
        if pickled_entry is not None:
            return self._load_entry(pickled_entry).return_result()

        result = execution.execute(self.func, execution.Parameters(args, kwargs))
        self._store_entry(r, key, result)

        return result.return_result()
Exemplo n.º 2
0
 def single(self, parameters):
     return execution.execute(self, parameters)
Exemplo n.º 3
0
 def __call__(self, *args, **kwargs):
     return execution.execute(self.func, execution.Parameters(args, kwargs)).return_result()
Exemplo n.º 4
0
def execute_all(func, multi, max_parallel=None):
    return execution.MultiResult({name: execution.execute(func, parameters) for name, parameters in multi.items()})