Like call_soon(), but thread-safe.
(self, callback, *args, context=None)
| 873 | "than the current one") |
| 874 | |
| 875 | def call_soon_threadsafe(self, callback, *args, context=None): |
| 876 | """Like call_soon(), but thread-safe.""" |
| 877 | self._check_closed() |
| 878 | if self._debug: |
| 879 | self._check_callback(callback, 'call_soon_threadsafe') |
| 880 | handle = events._ThreadSafeHandle(callback, args, self, context) |
| 881 | self._ready.append(handle) |
| 882 | if handle._source_traceback: |
| 883 | del handle._source_traceback[-1] |
| 884 | if handle._source_traceback: |
| 885 | del handle._source_traceback[-1] |
| 886 | self._write_to_self() |
| 887 | return handle |
| 888 | |
| 889 | def run_in_executor(self, executor, func, *args): |
| 890 | self._check_closed() |
no test coverage detected