MCPcopy Index your code
hub / github.com/python/cpython / _WorkItem

Class _WorkItem

Lib/concurrent/futures/thread.py:76–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76class _WorkItem:
77 def __init__(self, future, task):
78 self.future = future
79 self.task = task
80
81 def run(self, ctx):
82 if not self.future.set_running_or_notify_cancel():
83 return
84
85 try:
86 result = ctx.run(self.task)
87 except BaseException as exc:
88 self.future.set_exception(exc)
89 # Break a reference cycle with the exception 'exc'
90 self = None
91 else:
92 self.future.set_result(result)
93
94 __class_getitem__ = classmethod(types.GenericAlias)
95
96
97def _worker(executor_reference, ctx, work_queue):

Callers 1

submitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…