goblin

asyncio - how many coroutines?

…衆ロ難τιáo~ 提交于 2019-12-23 20:41:05
问题 I have been struggling for a few days now with a python application where I am expecting to look for a file or files in a folder and iterate through the each file and each record in it and create objects to be persisted on a Janusgraph database. The particular OGM that I am using, requires that the transactions with the database are done in an asynchronously using asyncio. I have read a lot of blogs, posts about asyncio and I think I understand the concept of async, await, tasks, etc... In my

How to obtain an event loop from Quart

心已入冬 提交于 2019-12-06 07:23:12
问题 Hello I fairly new to Python and I am trying to convert an existing application I have on Flask into Quart (https://gitlab.com/pgjones/quart) which is supposed to be built on top of asyncio, so I can use Goblin OGM to interact with JanusGraph or TinkerPop. According to the examples I found on Goblin I need to obtain an event loop to run the commands asynchronously. >>> import asyncio >>> from goblin import Goblin >>> loop = asyncio.get_event_loop() >>> app = loop.run_until_complete( ...

How to obtain an event loop from Quart

最后都变了- 提交于 2019-12-04 12:23:22
Hello I fairly new to Python and I am trying to convert an existing application I have on Flask into Quart ( https://gitlab.com/pgjones/quart ) which is supposed to be built on top of asyncio, so I can use Goblin OGM to interact with JanusGraph or TinkerPop. According to the examples I found on Goblin I need to obtain an event loop to run the commands asynchronously. >>> import asyncio >>> from goblin import Goblin >>> loop = asyncio.get_event_loop() >>> app = loop.run_until_complete( ... Goblin.open(loop)) >>> app.register(Person, Knows) However I can't find a way to obtain the event loop