MCPcopy
hub / github.com/opendevops-cn/opendevops / run

Method run

scripts/tornado_source_code/tornado/ioloop.py:492–511  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

490 future_cell = [None] # type: List[Optional[Future]]
491
492 def run() -> None:
493 try:
494 result = func()
495 if result is not None:
496 from tornado.gen import convert_yielded
497
498 result = convert_yielded(result)
499 except Exception:
500 fut = Future() # type: Future[Any]
501 future_cell[0] = fut
502 future_set_exc_info(fut, sys.exc_info())
503 else:
504 if is_future(result):
505 future_cell[0] = result
506 else:
507 fut = Future()
508 future_cell[0] = fut
509 fut.set_result(result)
510 assert future_cell[0] is not None
511 self.add_future(future_cell[0], lambda future: self.stop())
512
513 self.add_callback(run)
514 if timeout is not None:

Callers

nothing calls this directly

Calls 5

add_futureMethod · 0.95
stopMethod · 0.95
convert_yieldedFunction · 0.90
future_set_exc_infoFunction · 0.90
is_futureFunction · 0.90

Tested by

no test coverage detected