MCPcopy Index your code
hub / github.com/RustPython/RustPython / _WorkItem

Class _WorkItem

Lib/concurrent/futures/thread.py:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47class _WorkItem:
48 def __init__(self, future, fn, args, kwargs):
49 self.future = future
50 self.fn = fn
51 self.args = args
52 self.kwargs = kwargs
53
54 def run(self):
55 if not self.future.set_running_or_notify_cancel():
56 return
57
58 try:
59 result = self.fn(*self.args, **self.kwargs)
60 except BaseException as exc:
61 self.future.set_exception(exc)
62 # Break a reference cycle with the exception 'exc'
63 self = None
64 else:
65 self.future.set_result(result)
66
67 __class_getitem__ = classmethod(types.GenericAlias)
68
69
70def _worker(executor_reference, work_queue, initializer, initargs):

Callers 1

submitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected