Skip to main content
https://img.shields.io/pypi/v/gnsq.svg https://img.shields.io/travis/wtolson/gnsq.svg Documentation Status

A gevent based python client for NSQ distributed messaging platform.

Features include:

  • Free software: BSD license

  • Documentation: https://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.7+, Python 3.4+ and PyPy.

Usage

First make sure nsq is installed and running. Next create a producer and publish some messages to your topic:

import gnsq

producer = gnsq.Producer('localhost:4150')
producer.start()

producer.publish('topic', 'hello gevent!')
producer.publish('topic', 'hello nsq!')

Then create a Consumer to consume messages from your topic:

consumer = gnsq.Consumer('topic', 'channel', 'localhost:4150')

@consumer.on_message.connect
def handler(consumer, message):
    print 'got message:', message.body

consumer.start()

Compatibility

For NSQ 1.0 and later, use the major version 1 (1.x.y) of gnsq.

For NSQ 0.3.8 and earlier, use the major version 0 (0.x.y) of the library.

The recommended way to set your requirements in your setup.py or requirements.txt is:

# NSQ 1.x.y
gnsq>=1.0.0

# NSQ 0.x.y
gnsq<1.0.0

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.

Release files for gnsq 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gnsq 1.0.2
File Size Uploaded
gnsq-1.0.2.tar.gz 46.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gnsq 1.0.2
File Interpreter ABI Platform
gnsq-1.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 78.9 kB

Release files / gnsq-1.0.2.tar.gz

Download URL gnsq-1.0.2.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f2bb8cc816ffc449865ab1729eeec8b7524f7a416161cc99db2f44782a002c13
BLAKE2b-256 checksum
How to use checksums
3dc3e5edbf7abbc1b2947176ae487c37fff8bd7d47e47556057dc1274f82e8c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Release files / gnsq-1.0.2-py2.py3-none-any.whl

Download URL gnsq-1.0.2-py2.py3-none-any.whl
Size 32.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5c0d9cadb93430d10a2183621622c2b760b957c9b7c61c0573c7bb82a0c7774c
BLAKE2b-256 checksum
How to use checksums
a30600dd201554402843bfdab0c9892b96f57630cddbeecadccce4d5fb5853f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.1

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page