-
- Downloads
pika: Don't automatically import twisted and tornado.
Previously, the pika.adapters convenience import logic would end up importing Twisted, Tornado, and AsyncIO if they are present in the current Python environment, regardless of whether the user intended to use them. While the convenience names of e.g. `pika.TornadoConnection` (rather than the more verbose pika.adapters.TornadoConnection`) were nice, this had the downside of making importing pika expensive in those environments; on my system, twisted added 150ms and tornado 10ms to the based ~40ms import time for pika. We fix this by removing those convenience imports; now, a user needs to explicitly import pika.adapters.tornado_connection (aka plan to actually use the relevant adapter feature) in order to end up importing those large third-party modules. Fixes #1128.
Showing
- README.rst 7 additions, 5 deletionsREADME.rst
- docs/examples/asyncio_consumer.rst 2 additions, 2 deletionsdocs/examples/asyncio_consumer.rst
- docs/examples/tornado_consumer.rst 2 additions, 2 deletionsdocs/examples/tornado_consumer.rst
- pika/__init__.py 0 additions, 2 deletionspika/__init__.py
- pika/adapters/__init__.py 0 additions, 19 deletionspika/adapters/__init__.py
- tests/acceptance/async_test_base.py 4 additions, 4 deletionstests/acceptance/async_test_base.py
Loading
Please register or sign in to comment