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