Giter Site home page Giter Site logo

Twisted and asyncio about scrapy HOT 7 OPEN

abebus avatar abebus commented on June 19, 2024
Twisted and asyncio

from scrapy.

Comments (7)

abebus avatar abebus commented on June 19, 2024 2

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.

Gallaecio avatar Gallaecio commented on June 19, 2024

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.

wRAR avatar wRAR commented on June 19, 2024

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.

dream2333 avatar dream2333 commented on June 19, 2024

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.

shraddhakannurkar avatar shraddhakannurkar commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.