def execute(self):
stack = self._stack<EOL>callbacks = self._callbacks<EOL>promises = []<EOL>if stack:<EOL><INDENT>def process():<EOL><INDENT>"""<STR_LIT>"""<EOL>pipe = ConnectionManager.get(self.connection_name)<EOL>call_stack = []<EOL>futures = []<EOL>for item, args, kwargs, future in stack:<EOL><INDENT>f = getattr(pipe, item)<EOL>if callable(f):<EOL><INDENT>futures.append(future)<EOL>call_stack.append((f, args, kwargs))<EOL><DEDENT><DEDENT>for f, args, kwargs in call_stack:<EOL><INDENT>f(*args, **kwargs)<EOL><DEDENT>for i, v in enumerate(pipe.execute()):<EOL><INDENT>futures[i].set(v)<EOL><DEDENT><DEDENT>promises.append(process)<EOL><DEDENT>promises += [p.execute for p in self._pipelines.values()]<EOL>if len(promises) == <NUM_LIT:1>:<EOL><INDENT>promises[<NUM_LIT:0>]()<EOL><DEDENT>else:<EOL><INDENT>TaskManager.wait(*[TaskManager.promise(p) for p in promises])<EOL><DEDENT>for cb in callbacks:<EOL><INDENT>cb()<EOL><DEDENT>
Invoke the redispy pipeline.execute() method and take all the values
returned in sequential order of commands and map them to the
Future objects we returned when each command was queued inside
the pipeline.
Also invoke all the callback functions queued up.
:param raise_on_error: boolean
:return: None