Comments (7)
Yes, but it feels somewhat like a crutch, because conversion of futures to defers sometimes can be unpredictable.
I've had cases where scrapy engine closes all of its resources before some asyncio tasks were finished. Soon I will try reproduce this behaviour and provide it as a case in a new issue.
from scrapy.
Twisted works well and is actively developed.
Given that, and the fact that you can use asyncio code with Scrapy, I am not sure there is a point to migrating away from Twisted.
from scrapy.
I had a thought about replacing more of the native Deferred code and especially inlineCallbacks code with async def functions, as is recommended by Twisted itself, but rewriting the Scrapy core to remove Twisted completely sounds very hard.
from scrapy.
Migrating Scrapy from Twisted to asyncio was not an easy task. It requires a lot of work, including rewriting most of the code, and may also introduce new bugs. in addition, there are some functional differences between Twisted and asyncio, which may result in some features not being implemented on asyncio
from scrapy.
The perception of Twisted as being deprecated might come from the fact that asyncio is now part of the Python standard library and has gained a lot of traction, leading to a preference for asyncio in new projects. However, Twisted is still actively maintained and has a loyal user base. It's also worth noting that Twisted has been working on integrating with asyncio through the twisted.internet.asyncioreactor module, which allows Twisted to run on top of asyncio's event loop, giving developers the best of both worlds in some cases.
from scrapy.
Related Issues (20)
- Improve how combining DEFAULT_REQUEST_HEADERS with the Referer middleware is handled HOT 2
- `FEED_EXPORT_BATCH_ITEM_COUNT` not working HOT 3
- lxml parser gives back wrong parsing results, messes up html HOT 3
- UserAgent middleware stopped the spider HOT 1
- install scrapy for raspberry
- Contradiction in Documentation about installing scrapy HOT 1
- Test fails when pytest runs without pytest-cov argument HOT 1
- The first rule in a robots.txt with BOM will be ignored HOT 1
- Need support for making blank requests HOT 4
- PyPy tests fail HOT 1
- max_active_size gives no warning when queue processing blocked (can cause deadlock when deferring items in a pipeline) HOT 11
- Document the deprecation and removal of response_httprepr HOT 6
- ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. scrapy 2.11.0 requires Twisted<23.8.0,>=18.9.0, but you have twisted 23.10.0 which is incompatible. HOT 2
- Cleanup deprecated fingerprint code in scrapy.utils.request
- When using mongodb MotorClient with scrapy, async with await will introduce Runtime error HOT 11
- Import scrapy showing error HOT 3
- Implement get_import _path
- Replace urlparse with urlparse_cached where possible
- execution of asyncio.ensure_future(coro()) ignored on close_spider() pipelines call HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrapy.