跳转到主要内容

asyncio Groonga客户端库

项目描述

asyncio Groonga 客户端。

需求

  • Python3.5+

使用

GQTP

import asyncio
from aiogrn.client import GroongaClient

async def fetch(grn, cmd, **kwargs):
    ret = await grn.call(cmd, **kwargs)
    print(ret)

loop = asyncio.get_event_loop()
grn = GroongaClient(host='localhost', port=10043, protocol='gqtp', loop=loop)
tasks = [
        asyncio.ensure_future(fetch(grn, 'status')),
        asyncio.ensure_future(fetch(grn, 'select', table='Foo')),
        asyncio.ensure_future(fetch(grn, 'status'))]
loop.run_until_complete(asyncio.gather(*tasks))
loop.close()

HTTP

import asyncio
from aiogrn.client import GroongaClient

async def fetch(grn, cmd, **kwargs):
    ret = await grn.call(cmd, **kwargs)
    print(ret)

loop = asyncio.get_event_loop()
grn = GroongaClient(loop=loop)
tasks = [
        asyncio.ensure_future(fetch(grn, 'status')),
        asyncio.ensure_future(fetch(grn, 'select', table='Foo')),
        asyncio.ensure_future(fetch(grn, 'status'))]
loop.run_until_complete(asyncio.gather(*tasks))
loop.close()

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

aiogrn-0.0.1.tar.gz (3.2 kB 查看散列)

上传时间

构建分布

aiogrn-0.0.1-py2.py3-none-any.whl (4.1 kB 查看散列)

上传时间 Python 2 Python 3

由以下支持