def continue_with(self, continuation_func, *args):
future = Future()<EOL>def callback(f):<EOL><INDENT>try:<EOL><INDENT>future.set_result(continuation_func(f, *args))<EOL><DEDENT>except:<EOL><INDENT>future.set_exception(sys.exc_info()[<NUM_LIT:1>], sys.exc_info()[<NUM_LIT:2>])<EOL><DEDENT><DEDENT>self.add_done_callback(callback)<EOL>return future<EOL>
Create a continuation that executes when the Future is completed.

:param continuation_func: A function which takes the future as the only parameter. Return value of the function
will be set as the result of the continuation future.
:return: A new Future which will be completed when the continuation is done.