MCPcopy
hub / github.com/tornadoweb/tornado / handle_yield

Method handle_yield

tornado/gen.py:824–845  ·  view source on GitHub ↗
(self, yielded: _Yieldable)

Source from the content-addressed store, hash-verified

822 self.running = False
823
824 def handle_yield(self, yielded: _Yieldable) -> bool:
825 try:
826 self.future = convert_yielded(yielded)
827 except BadYieldError:
828 self.future = Future()
829 future_set_exc_info(self.future, sys.exc_info())
830
831 if self.future is moment:
832 self.io_loop.add_callback(self.ctx_run, self.run)
833 return False
834 elif self.future is None:
835 raise Exception("no pending future")
836 elif not self.future.done():
837
838 def inner(f: Any) -> None:
839 # Break a reference cycle to speed GC.
840 f = None # noqa: F841
841 self.ctx_run(self.run)
842
843 self.io_loop.add_future(self.future, inner)
844 return False
845 return True
846
847 def handle_exception(
848 self, typ: Type[Exception], value: Exception, tb: types.TracebackType

Callers 1

runMethod · 0.95

Calls 5

future_set_exc_infoFunction · 0.90
convert_yieldedFunction · 0.85
add_futureMethod · 0.80
add_callbackMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected