- 27 7月, 2023 1 次提交
-
-
由 Ben Darnell 提交于
This required a recent update to typeshed/mypy. Fixes #3093
-
- 08 7月, 2023 1 次提交
-
-
由 Ben Darnell 提交于
This hook was added because of an only-in-CI issue, but we have since improved our cleanup of the selector thread. As long as this passes CI, I think we can remove the atexit hook. Fixes #3291
-
- 20 6月, 2023 2 次提交
-
-
由 Ben Darnell 提交于
-
由 Ben Darnell 提交于
Async generators have a special shutdown protocol which allows us to detect the end of the event loop and stop our thread. This lets us clean up the thread reliably when the event loop is started/stopped via the tornado IOLoop interfaces (which explicitly know about the selector thread), or when the latest asyncio interfaces are used (asyncio.run or manually calling shutdown_asyncgens). The thread is still leaked when older versions of the asyncio interfaces are used (loop.close *without* shutdown_asyncgens), but I've been unable to find a solution that does not print leak warnings even in the event of a clean shutdown. Use of shutdown_asyncgens is now effectively required for apps combining asyncio and tornado. This is unfortunate since leaking a thread is relatively expensive compared to the usual consequences of failing to call shutdown_asyncgens, but it seems to be the best we can do. Fixes #3173
-
- 03 5月, 2023 1 次提交
-
-
由 Ben Darnell 提交于
I don't believe this method is currently working as intended, and I'm not sure it ever has since the move to asyncio. I think this is responsible for occasional test failures in CI. Fixes #3225
-
- 16 2月, 2023 2 次提交
-
-
由 Thomas Kluyver 提交于
-
由 Thomas Kluyver 提交于
-
- 15 2月, 2023 1 次提交
-
-
由 Thomas Kluyver 提交于
-
- 09 2月, 2023 2 次提交
-
-
由 Thomas Kluyver 提交于
-
由 Ben Darnell 提交于
AsyncioLoop.start() used to save, set, and restore the thread-local event loop. This avoided some edge cases in early versions of asyncio; this appears to no longer be necessary since Python 3.7 introduced the get_running_loop() method. Removing this logic improves compatibility with Python 3.12, where it is difficult if not impossible to do the same thing without generating DeprecationWarnings.
-
- 28 11月, 2022 1 次提交
-
-
由 Ben Darnell 提交于
-
- 21 6月, 2022 1 次提交
-
-
由 Thomas Grainger 提交于
-
- 20 6月, 2022 1 次提交
-
-
由 Thomas Grainger 提交于
-
- 17 6月, 2022 1 次提交
-
-
由 Min RK 提交于
so warnings are associated with the line where the deprecated methods are called rather than the line where the warning itself is
-
- 16 6月, 2022 2 次提交
- 15 6月, 2022 1 次提交
-
-
由 Min RK 提交于
allows patterns of creating and explicitly passing the asyncio loop before creating IOLoop For example: creating a loop with the non-default event loop policy without having to set the current policy
-
- 31 3月, 2022 1 次提交
-
-
由 Thomas Grainger 提交于
-
- 19 3月, 2022 2 次提交
-
-
由 Thomas Grainger 提交于
* avoid thread unsafe iteration of _ioloop_for_asyncio See https://twitter.com/raymondh/status/1252759650224619521 * catch KeyError from potential concurrent _ioloop_for_asyncio deletes
-
由 Thomas Grainger 提交于
`with warnings.catch_warnings():` mutates the warnings filters for the whole process and so is unsafe to call from multiple threads
-
- 17 1月, 2022 3 次提交
-
-
由 Ben Darnell 提交于
Also avoid deprecated asyncio.get_event_loop in asyncio_test.
-
由 Ben Darnell 提交于
asyncio.get_event_loop and related methods are deprecated in python 3.10, so deprecate some IOLoop functionality to match. Specifically, make_current, clear_current, and the IOLoop constructor are deprecated in favor of initializing the asyncio event loop and calling IOLoop.current(). (The IOLoop constructor is not deprecated if make_current=False is used. This is useful in test frameworks but is not expected to see general use).
-
由 Ben Darnell 提交于
Implicit creation of event loops has been deprecated in Python 3.10. Since AnyThreadEventLoopPolicy modifies the rules for implicit loop creation, it is also deprecated.
-
- 03 9月, 2021 1 次提交
-
-
由 Min RK 提交于
same catch as in `add_callback` for the same reasons - the selector thread may race with an asyncio_loop.close in the main thread seen running tests with pytest-asyncio
-
- 01 6月, 2021 1 次提交
-
-
由 Pierce Lopez 提交于
clean-up some methods that were missed in https://github.com/tornadoweb/tornado/pull/2924
-
- 30 5月, 2021 1 次提交
-
-
由 Pierce Lopez 提交于
ISSUE: https://github.com/tornadoweb/tornado/issues/2828 * ioloop: call_later() and call_at() take any Callable coroutine or plain, returning any type Co-authored-by: Nagnewee <agnewee@gmail.com>
-
- 19 5月, 2021 1 次提交
-
-
由 Min RK 提交于
according to spec: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.close The call to _wake_selector would fail with EBADF when close is called a second time
-
- 10 5月, 2021 1 次提交
-
-
由 Min RK 提交于
so it can be used on an existing asyncio loop without replacing the loop itself
-
- 01 11月, 2020 1 次提交
-
-
由 Ben Darnell 提交于
-
- 24 10月, 2020 1 次提交
-
-
由 Ben Darnell 提交于
Python 3.9 changed the behavior of ThreadPoolExecutor at interpreter shutdown (after the already-tricky import-order issues around atexit hooks). Avoid these issues by managing the thread by hand.
-
- 30 9月, 2020 1 次提交
-
-
由 Ben Darnell 提交于
-
- 13 9月, 2020 1 次提交
-
-
由 Poruri Sai Rahul 提交于
On Python 3, super does not need to be called with arguments where as on Python 2, super needs to be called with a class object and an instance. This commit updates the super usage using automated regex-based search and replace. After the automated changes were made, each change was individually checked before committing.
-
- 02 9月, 2020 3 次提交
-
-
由 Ben Darnell 提交于
Restarting the event loop to "cleanly" shut down a coroutine introduces other problems (mainly manifesting as errors logged while running tornado.test.gen_test). Replace the coroutine with a pair of callbacks so we don't need to do anything special to shut down without logging warnings.
-
由 Ben Darnell 提交于
Running a whole event loop on the other thread leads to tricky synchronization problems. Instead, keep as much as possible on the main thread, and call out to a second thread only for the blocking select system call itself.
-
由 Ben Darnell 提交于
This commit removes the need for applications to work around the backwards-incompatible change to the default event loop. Instead, Tornado will detect the use of the windows proactor event loop and start a selector event loop in a separate thread. Closes #2804
-
- 15 5月, 2020 1 次提交
-
-
由 marc 提交于
-
- 20 1月, 2020 1 次提交
-
-
由 Ben Darnell 提交于
-
- 07 10月, 2018 1 次提交
-
-
由 Ben Darnell 提交于
It occasionally makes some odd-looking decisions and uses a lot of vertical space but overall it's a big improvement, especially for the dense type signatures.
-
- 17 9月, 2018 1 次提交
-
-
由 Matthew Rocklin 提交于
* Add thread identity check to add_callback Fixes #2463 This reduces the overhead of add_callback when called on the same thread as the event loop. This uses asyncio's call_soon rather than call_soon_threadsafe. * Separately define add_callback_from_signal
-
- 12 8月, 2018 1 次提交
-
-
由 Ben Darnell 提交于
-