Skip to main content

asyncio Groonga Client library

Project description

asyncio Groonga Client.

Requirements

  • Python3.5+

Usage

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiogrn-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

aiogrn-0.0.1-py2.py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page