Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A gevent based python client for the NSQ distributed messaging platform.

License

NotificationsYou must be signed in to change notification settings

wtolson/gnsq

Repository files navigation

Documentation Status

Agevent based python client forNSQ distributed messaging platform.

Features include:

  • Free software: BSD license
  • Documentation:https://gnsq.readthedocs.org
  • Battle tested on billions and billions of messages </sagan>
  • Based ongevent for fast concurrent networking
  • Fast and flexible signals withBlinker
  • 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 isinstalled and running. Next create a producer andpublish some messages to your topic:

import gnsqproducer = 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.connectdef handler(consumer, message):    print 'got message:', message.bodyconsumer.start()

Compatibility

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

ForNSQ 0.3.8 and earlier, use the major version 0 (0.x.y) of thelibrary.

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

# NSQ 1.x.ygnsq>=1.0.0# NSQ 0.x.ygnsq<1.0.0

Dependencies

Optional snappy support depends on the python-snappy package which in turndepends 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 thecontributing guide for details on how to help and setup a developmentenvironment.

About

A gevent based python client for the NSQ distributed messaging platform.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp