• Stars
    star
    148
  • Rank 248,614 (Top 5 %)
  • Language
    Python
  • License
    Mozilla Public Li...
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ZeroMQ bindings for Twisted

Twisted bindings for 0MQ

https://coveralls.io/repos/smira/txZMQ/badge.png

Introduction

txZMQ allows to integrate easily ØMQ sockets into Twisted event loop (reactor).

txZMQ supports both CPython and PyPy and ØMQ library version 2.2.x or 3.2.x.

Documentation is available at ReadTheDocs.

Requirements

C library required:

  • ØMQ library 2.2.x or 3.2.x

Python packages required:

  • pyzmq >= 13 (for CPython & PyPy)
  • Twisted

Details

txZMQ introduces support for general 0MQ sockets by class ZmqConnection that can do basic event loop integration, sending-receiving messages in non-blocking manner, scatter-gather for multipart messages.

txZMQ uses ØMQ APIs to get file descriptor that is used to signal pending actions from ØMQ library IO thread running in separate thread. This is used in a custom file descriptor reader, which is then added to the Twisted reactor.

Upgrading from 0.3.x

If you're upgrading from version 0.3.1 and earlier, please apply following changes to your code:

  • root package name was changed from txZMQ to txzmq, adjust your imports accordingly;
  • ZmqEndpointType.Connect has been renamed to ZmqEndpointType.connect;
  • ZmqEndpointType.Bind has been renamed to ZmqEndpointType.bind;
  • ZmqConnection.__init__ has been changed to accept keyword arguments instead of list of endpoints; if you were using one endpoint, no changes are required; if using multiple endpoints, please look for add_endpoints method.

Hacking

Source code for txZMQ is available at github; forks and pull requests are welcome.

To start hacking, fork at github and clone to your working directory. To use the Makefile (for running unit tests, checking for PEP8 compliance and running pyflakes), you will want to have virtualenv installed (it includes a pip installation).

Create a branch, add some unit tests, write your code, check it and test it! Some useful make targets are:

  • make env
  • make check
  • make test

If you don't have an environment set up, a new one will be created for you in ./env. Additionally, txZMQ will be installed as well as required development libs.

More Repositories

1

redis-resharding-proxy

Redis Resharding Proxy
Go
176
star
2

go-statsd

Go statsd client library with zero allocation overhead, great performance and reconnects
Go
96
star
3

go-point-clustering

(Lat, lon) points fast clustering using DBScan algorithm
Go
47
star
4

py-numa

Python interface to NUMA Linux library
Python
23
star
5

memcached_functions_mysql

Memcached functions for MySQL as UDF, tailored for usage in replication and pushing data to MemcacheQ
C
22
star
6

go-kmip

KMIP protocol implementation in Go
Go
21
star
7

fmspy

FMSPy provides implementation of RTMP protocol upon Twisted Framework. On top of protocol implementation it builds server for Flash/Flex/Haxe/... clients.
Python
18
star
8

go-ftp-protocol

Plugin for http.Transport with support for ftp:// protocol
Go
5
star
9

spamfighter

Web-service fighting spam and other unsolicited messages (comments, chat etc.)
Python
5
star
10

exponential-backoff

Exponential backoff vs. simple backoff test.
Go
4
star
11

lib_mysqludf_json

MySQL UDF for building JSON serialized records
C
4
star
12

mysql_udf_unix_timestamp_ms

Implementation of UNIX_TIMESTAMP() that returns UNIX time since epoch with sub-second precision (float)
C
3
star
13

libcheckpoint

Prototype of POSIX user-space checkpointing library
C
2
star
14

gopherconru2018

Implementing efficient statsd client library in Go
Go
2
star
15

goose

Fork of https://bitbucket.org/liamstask/goose
Go
1
star
16

zap-msgpack-encoder

Encoder to msgpack format for go.uber.org/zap logging module
Go
1
star
17

conference

Conference Papers
1
star
18

blog

Source code for http://www.smira.ru/
Python
1
star
19

czar

Distributed monitoring and provisioning system
Go
1
star
20

lzma

Mirror of code.google.com/p/lzma
Go
1
star
21

giantswarm-firstapp-go

A simple example with Go, Redis and Docker demonstrating Giant Swarm
Go
1
star