MCPcopy Create free account
hub / github.com/EasyIME/PIME / handle_yield

Method handle_yield

python/python3/tornado/gen.py:804–825  ·  view source on GitHub ↗
(self, yielded: _Yieldable)

Source from the content-addressed store, hash-verified

802 self.running = False
803
804 def handle_yield(self, yielded: _Yieldable) -> bool:
805 try:
806 self.future = convert_yielded(yielded)
807 except BadYieldError:
808 self.future = Future()
809 future_set_exc_info(self.future, sys.exc_info())
810
811 if self.future is moment:
812 self.io_loop.add_callback(self.ctx_run, self.run)
813 return False
814 elif self.future is None:
815 raise Exception("no pending future")
816 elif not self.future.done():
817
818 def inner(f: Any) -> None:
819 # Break a reference cycle to speed GC.
820 f = None # noqa: F841
821 self.ctx_run(self.run)
822
823 self.io_loop.add_future(self.future, inner)
824 return False
825 return True
826
827 def handle_exception(
828 self, typ: Type[Exception], value: Exception, tb: types.TracebackType

Callers 2

__init__Method · 0.95
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