Re: Looking for examples of using aiopg with aiohttp and non-async startup.

2016-02-26 Thread Ray Cote
Answer (obvious after a refreshing sleep): Just run a separate async pool connection prior to kicking off the aiohttp web application. The startup now looks like: async def connect(): return await aiopg.create_pool(…) if __name__ == “__main__”: loop = asyncio.get_event_loop() pool = l

Looking for examples of using aiopg with aiohttp and non-async startup.

2016-02-25 Thread Ray Cote
Hello: I have an aiohttp project that starts in the usual way: app = web.Application() app.router.add_route(‘POST”, ‘/‘, handler) web.run_app(app) My question is, how do I work with an aiopg.pool with aiohttp? There only seems to be async interfaces into aiopg — but I don’t want to create the po