Giter VIP home page Giter VIP logo

Comments (16)

5hirish avatar 5hirish commented on August 27, 2024 2

Working on it, except I am getting 404s for requests defined following the first API request.

import responder

api = responder.API()

@api.route("/hello")
async def greet_world(req, resp):
    resp.text = f"Hello, world!"

@api.route("/bye")
async def bye_world(req, resp):
    resp.media = {"data": "Bye, world!"}

if __name__ == '__main__':
    api.run()

Here /hello returns 200 but /bye returns 404. If I change the sequence of declaration then /bye works.

from responder.

tomchristie avatar tomchristie commented on August 27, 2024 2

Make sure to update to the latest uvicorn.

You’re seeing an integration issue there as uvicorn is sending ASGI lifespan messages that responder doesn’t yet handle. However the latest version of uvicorn should deal with that gracefully.

from responder.

tomchristie avatar tomchristie commented on August 27, 2024 2

@5hirish good work. They have a continuous benchmarking suite running, tho it has a turnover time of 2 or 3 days. Check https://tfb-status.techempower.com/ and you should see their latest results soon enough.

from responder.

5hirish avatar 5hirish commented on August 27, 2024 1

Thanks for informing... BTW I am getting this responder: ERROR: Framework is not accepting requests from client machine in the CI console might be due to the above issue I guess...In my local, at least the first API was working...Will have to wait for the next release.

from responder.

5hirish avatar 5hirish commented on August 27, 2024

https://github.com/5hirish/FrameworkBenchmarks/blob/responder/frameworks/Python/responder/app.py

from responder.

kennethreitz avatar kennethreitz commented on August 27, 2024

that's because you named your function the same thing twice

from responder.

5hirish avatar 5hirish commented on August 27, 2024

@kennethreitz sorry, that was copy-paste typo, fixed it, but still, the issue is reproducible, can try running the app.py from my fork. Or am I declaring something wrong here?

from responder.

5hirish avatar 5hirish commented on August 27, 2024

@tomchristie I have created a PR on the TechEmpower repo: (Still, haven't resolved the issue mentioned above. Maybe it is happening only for my system...?) TechEmpower/FrameworkBenchmarks#4122

from responder.

sheb avatar sheb commented on August 27, 2024

@5hirish I had the same problem with v.0.0.3, but seems to be fixed on master

from responder.

5hirish avatar 5hirish commented on August 27, 2024

Tried running the docker file in local, to pin point the error in docker run. I executed the the gunicorn task separately
gunicorn app:app --log-level debug -k uvicorn.workers.UvicornWorker -c responder_conf.py
I am getting the following error:

Exception in 'lifespan' protocol
Traceback (most recent call last):
  File "/home/felix/.pyenv/versions/3.6.5/envs/pyw365/lib/python3.6/site-packages/uvicorn/lifespan.py", line 29, in run
    await self.asgi(self.receive, self.send)
  File "/home/felix/.pyenv/versions/3.6.5/envs/pyw365/lib/python3.6/site-packages/uvicorn/middleware/message_logger.py", line 51, in __call__
    inner = self.app(self.scope)
  File "/home/felix/.pyenv/versions/3.6.5/envs/pyw365/lib/python3.6/site-packages/responder/api.py", line 100, in __call__
    path = scope["path"]
KeyError: 'path'

from responder.

5hirish avatar 5hirish commented on August 27, 2024

Will update the benchmarks when the PR is approved and merged. @tomchristie responder doesn't need Jinja dependency but the api.template() call was not taking template file path as an argument, hence reverted to external Jinja dependency and usage. If this will affect the performance any form then let me know.

from responder.

therumbler avatar therumbler commented on August 27, 2024

the Tech Empower benchmark has completed, and includes Responder's results now.
https://www.techempower.com/benchmarks/#section=test&runid=a0d523de-091b-4008-b15d-bd4c8aa25066

from responder.

5hirish avatar 5hirish commented on August 27, 2024

@tomchristie can close this issue. PR: Update ReadMe #130

from responder.

kennethreitz avatar kennethreitz commented on August 27, 2024

@therumbler we were included in the last batch -- any idea why?

from responder.

tomchristie avatar tomchristie commented on August 27, 2024

I guess it must have just missed the round 17 cutoff.

from responder.

waghanza avatar waghanza commented on August 27, 2024

@tomchristie I have tested tfb

leads me to a socket.gaierror: [Errno -2] Name or service not known

from responder.

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.