Arrange for a callback to be called as soon as possible. This operates as a FIFO queue: callbacks are called in the order in which they are registered. Each callback will be called exactly once. Any positional arguments after the callback will be passed to
(self, callback, *args, context=None)
| 820 | return timer |
| 821 | |
| 822 | def call_soon(self, callback, *args, context=None): |
| 823 | """Arrange for a callback to be called as soon as possible. |
| 824 | |
| 825 | This operates as a FIFO queue: callbacks are called in the |
| 826 | order in which they are registered. Each callback will be |
| 827 | called exactly once. |
| 828 | |
| 829 | Any positional arguments after the callback will be passed to |
| 830 | the callback when it is called. |
| 831 | """ |
| 832 | self._check_closed() |
| 833 | if self._debug: |
| 834 | self._check_thread() |
| 835 | self._check_callback(callback, 'call_soon') |
| 836 | handle = self._call_soon(callback, args, context) |
| 837 | if handle._source_traceback: |
| 838 | del handle._source_traceback[-1] |
| 839 | return handle |
| 840 | |
| 841 | def _check_callback(self, callback, method): |
| 842 | if (coroutines.iscoroutine(callback) or |
no test coverage detected