Skip to main content

A gevent based python client for NSQ.

Project description

https://badge.fury.io/py/gnsq.svg https://travis-ci.org/wtolson/gnsq.svg?branch=master https://pypip.in/d/gnsq/badge.png

A gevent based python client for NSQ.

Features include:

  • Free software: BSD license

  • Documentation: http://gnsq.readthedocs.org

  • Battle tested on billions and billions of messages </sagan>

  • Based on gevent for fast concurrent networking

  • Fast and flexible signals with Blinker

  • Automatic nsqlookupd discovery and back-off

  • Support for TLS, DEFLATE, and Snappy

  • Full HTTP clients for both nsqd and nsqlookupd

Installation

At the command line:

$ easy_install gnsq

Or even better, if you have virtualenvwrapper installed:

$ mkvirtualenv gnsq
$ pip install gnsq

Currently there is support for Python 2.6 and Python 2.7. Support for Python 3 is dependent on gevent support.

Usage

To use gnsq in a project:

import gnsq
reader = gnsq.Reader('topic', 'channel', 'localhost:4150')

@reader.on_message.connect
def handler(reader, message):
    do_work(message.body)

reader.start()

Dependencies

Optional snappy support depends on the python-snappy package which in turn depends on libsnappy:

# Debian
$ sudo apt-get install libsnappy-dev

# Or OS X
$ brew install snappy

# And then install python-snappy
$ pip install python-snappy

Contributing

Feedback, issues, and contributions are always gratefully welcomed. See the contributing guide for details on how to help and setup a development environment.

History

0.1.4 (2014-07-24)

  • Preemptively update ready count.

  • Dependency and contributing documentation.

  • Support for nsq back to 0.2.24.

0.1.3 (2014-07-08)

  • Block as expected on start, even if already started.

  • Raise runtime error if starting the reader without a message handler.

  • Add on_close signal to the reader.

  • Allow upgrading to tls+snappy or tls+deflate.

0.1.2 (2014-07-08)

  • Flush delfate buffer for each message.

0.1.1 (2014-07-07)

  • Fix packaging stream submodule.

  • Send queued messages before closing socket.

  • Continue to read from socket on EAGAIN

0.1.0 (2014-07-07)

  • First release on PyPI.

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

gnsq-0.1.4.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

gnsq-0.1.4-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gnsq-0.1.4.tar.gz.

File metadata

  • Download URL: gnsq-0.1.4.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gnsq-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2422e1d27cda071f8652f04a5209bf686cde5a3400dd16da35aae2f6070c0129
MD5 b0ec70c6f57c59e54db35818218a3b10
BLAKE2b-256 26e1ca3cf87fd18d391ba3c765373a16ce34b66e84e298f01b0af5ea431d7199

See more details on using hashes here.

Provenance

File details

Details for the file gnsq-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for gnsq-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb75fb7d0cf59c7d906dca54f67b1707339c196d3db9bbfbf1337a3f97933518
MD5 cc762405dc5c25bb2734a5d392dad386
BLAKE2b-256 aafe72c18958a77654d0ab61e899b5a0ec1944425620922d5a0b044c4ddc941a

See more details on using hashes here.

Provenance

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