Comments (16)
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.
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.
@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.
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.
https://github.com/5hirish/FrameworkBenchmarks/blob/responder/frameworks/Python/responder/app.py
from responder.
that's because you named your function the same thing twice
from responder.
@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.
@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.
@5hirish I had the same problem with v.0.0.3
, but seems to be fixed on master
from responder.
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.
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.
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.
@tomchristie can close this issue. PR: Update ReadMe #130
from responder.
@therumbler we were included in the last batch -- any idea why?
from responder.
I guess it must have just missed the round 17 cutoff.
from responder.
@tomchristie I have tested tfb
- Cloning https://github.com/TechEmpower/FrameworkBenchmarks
- Updating deps -> pip3 install -r requirements.txt
- Running -> gunicorn app:app -k uvicorn.workers.UvicornWorker -c responder_conf.py
leads me to a socket.gaierror: [Errno -2] Name or service not known
from responder.
Related Issues (20)
- Docs: being more explicit about why to use api.background.task HOT 2
- Add documentation for response streaming
- Stop stream response if client disconnects HOT 1
- [Feature Request] OpenAPI Schema Support with Pydantic
- Potential code quality improvements HOT 7
- MultiRelay not working - Blank screen
- Run with workers argument doesn't work
- api.jinja_values_base removed? HOT 2
- AttributeError: module 'typesystem' has no attribute 'SchemaDefinitions' HOT 2
- Fail to install: Python 3.9 HOT 5
- AttributeError: 'str' object has no attribute 'decode'
- Missing uvloop on default setup HOT 3
- Static file changes require server restart
- [Feature Request] - request context middleware like starlette-context
- AttributeError: module 'typesystem' has no attribute 'SchemaDefinitions': incompatibility with typesystem v0.3.0 HOT 1
- Uvicorn version too old ?
- doc website 404 HOT 1
- Vulnerability in referenced starlette version
- Can't install on Debian bookworm with python 3. HOT 2
- New release pending? / Python >= 3.11 need a compiler when installing HOT 3
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 responder.