def call_task_fn(self):
if not self.fn:<EOL><INDENT>return self.log_finished()<EOL><DEDENT>future = asyncio.Future()<EOL>future.add_done_callback(lambda x: self.log_finished())<EOL>if inspect.iscoroutinefunction(self.fn):<EOL><INDENT>f = asyncio.ensure_future(self.fn())<EOL>f.add_done_callback(lambda x: self.bind_end(x.result(), future))<EOL><DEDENT>else:<EOL><INDENT>self.bind_end(self.fn(), future)<EOL><DEDENT>return future<EOL>
Call the function attached to the task.