skip to navigation
skip to content

aionsq 0.1.0a0

Implements nsq client for asyncio with async/await feature.

Documentation is available at http://aio.errorist.io/aionsq.

Installation

python -m pip install aionsq

Usage

Publish message to a nsq:

from aionsq.http import NSQWriter
writer = NSQWriter('http://120.0.0.1:4567')
await writer.publish('test', 'hello world 2')

Connect directly to a nsq daemon:

from aionsq.tcp import NSQReader
reader = NSQReader('http://120.0.0.1:4567', 'topic1', 'chan1')

@reader.subscribe('test')
async def consumer(msg):
    msg.success()

await reader.start()

Request nsq lookup:

from aionsq import NSQLookup
lookup = NSQLookup('http://120.0.0.1:4567')
info = await lookup.info()

Start an authd:

python -m aionsq.authd
 
File Type Py Version Uploaded on Size
aionsq-0.1.0a0-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2016-05-26 16KB
aionsq-0.1.0a0.tar.gz (md5) Source 2016-05-26 25KB