eyepea / api-hour Goto Github PK
View Code? Open in Web Editor NEWWrite efficient network daemons (HTTP, SSH...) with ease.
Home Page: http://pythonhosted.org/api_hour/
License: Other
Write efficient network daemons (HTTP, SSH...) with ease.
Home Page: http://pythonhosted.org/api_hour/
License: Other
Just kicking the tyres on your project...which seems really interesting btw.
To try things out I ran the all_in_one.py script in the examples directory but was getting errors from gunicorn
....
File "/Users/leon/envs/midi-sequencer/lib/python3.4/site-packages/gunicorn/config.py", line 58, in __getattr__
raise AttributeError("No configuration setting for: %s" % name)
AttributeError: No configuration setting for: debug
Providing a default for Gunicorn's debug setting seems to fix things for me.
This is what I added
leonh@259e8ee
Is there any performance advantage to using this over just normal aiohttp + gunicorn? Maybe the readme could provide benchmarks comparing it to a normal aiohttp stack as well
https://github.com/Eyepea/API-Hour/blob/master/benchmarks/flask/application.py
Is there any reason specifically why we are using psycopg directly instead of using something like Flask-SQLAlchemy (http://pythonhosted.org/Flask-SQLAlchemy/)?
It's pretty much the standard for interacting with PostgreSQL and Flask-SQLAlchemy is almost always the preferred method when in the wild. I can whip one up really quickly if we want to add another benchmark into the mix.
Spent 2 days trying to run api_hour with project updated to aiohttp==3.0.9
I'm running it with command:
/usr/local/bin/api_hour --chdir /path/to/project server:Container -b 127.0.0.7:8000 --log-level=DEBUG
And it starts great but when I try to connect I have: "no data received" or "connection reset by peer" message. No logs in terminal, no errors. It seems like api-hour even can't handle request.
The same config works great with aiohttp==2.2.5 but now fails.
probably using uvloop you can get much better performance, its interesting how this compare to flask/gunicorn/uwsgi.
Hi.
Apologize if I open an issue but I cannot post on google groups (don't know why)
I would like to use motor with api-hour, but I can't understand how to implement it.
I'm stucked here:
@asyncio.coroutine
def start(self):
yield from super().start()
LOG.info('Starting engines...')
'''
# Add your custom engines here, example with PostgreSQL:
self.engines['pg'] = self.loop.create_task(aiopg.create_pool(host=self.config['engines']['pg']['host'],
port=int(self.config['engines']['pg']['port']),
sslmode='disable',
dbname=self.config['engines']['pg']['dbname'],
user=self.config['engines']['pg']['user'],
password=self.config['engines']['pg']['password'],
cursor_factory=psycopg2.extras.RealDictCursor,
minsize=int(self.config['engines']['pg']['minsize']),
maxsize=int(self.config['engines']['pg']['maxsize']),
loop=self.loop))
'''
self.engines['mongo'] = motor_asyncio.AsyncIOMotorClient()
# yield from asyncio.wait([self.engines['pg']], return_when=asyncio.ALL_COMPLETED)
yield from asyncio.wait([self.engines['mongo']], return_when=asyncio.ALL_COMPLETED)
I can't understand how to initialize motor.
Many thanks,
giovanni
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.