Coder Social home page Coder Social logo

Comments (7)

asvetlov avatar asvetlov commented on May 13, 2024 1

But your example works as expected!

from async-timeout.

iAnanich avatar iAnanich commented on May 13, 2024

@asvetlov I need some time to find out why it was an error...

from async-timeout.

iAnanich avatar iAnanich commented on May 13, 2024

@asvetlov

But your example works as expected!

What do you mean "expected"?

http://127.0.0.1:8000 URL throws 500 HTTP code and prints in console RuntimeError: Timeout context manager should be used inside a task error.

Maybe you are using another package version? I have updated first post with requirements.

from async-timeout.

asvetlov avatar asvetlov commented on May 13, 2024

Your example works in new environment with versions specified in requirements.txt.
The only difference I have Python 3.5.3

from async-timeout.

asvetlov avatar asvetlov commented on May 13, 2024

Anyway, what text are you suggesting?
Current words describe situation when context manager is used from regular callback, tornado's callback or if the loop was not running.

from async-timeout.

iAnanich avatar iAnanich commented on May 13, 2024

@asvetlov I'm not fully understand what is callback. Please, help me understand.

I just doesn't understand why it have raised an error (as I understand, timeout class must call asyncio.get_event_loop at initialisation and store the result in _loop attribute to use it on __entry__ method call, and it gets initialised when A.am method called which heppens when I make request to http://127.0.0.1:8000/ URl). And my suggestiongs for the text are dependend on previous "why" question.

from async-timeout.

iAnanich avatar iAnanich commented on May 13, 2024

Because the best error message must tell me what line of code is wrong. But in the reality it isn't possible and I expect just helpfull message that points me at problem. In this case, when using 3.5.2, it isn't for me, because in my head context manager is inside coroutine method, executed inside event loop. But if it is fixed in Python 3.5.3, and everyone can use asyncio.get_event_loop, thats no problem.

from async-timeout.

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.