Coder Social home page Coder Social logo

Params of get/post functions about grequests HOT 3 CLOSED

latot avatar latot commented on August 16, 2024
Params of get/post functions

from grequests.

Comments (3)

spyoungtech avatar spyoungtech commented on August 16, 2024

In the map method, the gtimeout parameter is passed to gevent's joinall method. This is not to be confused with the timeout parameter normally accepted by the HTTP verb methods in requests/grequests.
In the imap method, we do not use gevent.joinall so there's no opportunity to provide a timeout parameter in this case with respect to how gevent handles the eventlets. I'm not sure if that's something that can be reasonably changed or not.

What might work for you is providing the timeout parameter to the request instead of relying on the gevent timeout.

rs = [grequests.get(url, timeout=10) for url in urls]
grequests.map(rs)

Hope that helps.

from grequests.

latot avatar latot commented on August 16, 2024

Hi, I try it with post, sadly fails, I want to show a test, but I need to wait until #162

from grequests.

latot avatar latot commented on August 16, 2024

mm, no idea why now works, I'll close it. Thx!

from grequests.

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.