我是这个名为 Goblin 的 Gremlin 驱动程序的新手。我正在关注Goblin - Async Python toolkit的介绍/教程。如文档中所述,我创建了一个 Python 协程:
loop = asyncio.get_event_loop()
app = loop.run_until_complete(loop)
app.register(Person, Knows)
async def go(app):
session = await app.session()
leif = Person()
leif.name = 'Leif'
leif.age = 28
jon = Person()
jon.name = 'Jonathan'
works_with = Knows(leif, jon)
session.add(leif, jon, works_with)
await session.flush()
result = await session.g.E(works_with.id).next()
assert result is works_with
people = session.traversal(Person) # element class based traversal source
async for person in people:
print(person)
当我运行 Python 脚本时,程序似乎陷入了无限循环。此时控制台中既没有显示结果也没有显示错误。
希望任何人都可以帮助我!艾伦