Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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


Release history Release notifications

Download files

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

Files for aiogrn, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size aiogrn-0.0.1-py2.py3-none-any.whl (4.1 kB) File type Wheel Python version 3.5 Upload date Hashes View hashes
Filename, size aiogrn-0.0.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page