Coder Social home page Coder Social logo

python-synapse's Introduction

README for python-synapse

Overview

Synapse is a simple Python module that provides a communication interface through nodes. It abstracts the underlying protocol. The configuration stores protocol specific data and a node is instanciated with the node.makeNode() factory.

The node is the unit of communication. Actor is built on top of Node to provide a distributed communication interface. When an actor joins the network it announces itself to a announce service. The announce is stored in the remote service and broadcast to all other nodes by a pub/sub queue.

Currently it supports Zeromq as the underlying protocol and JSON-RPC to encode and decode messages.

Read doc/quickstart for a practical introduction. As documentation in doc/ is in Sphinx format, type make in the directory to see how to build it in HTML or PDF.

Tests

launch all the tests:

$ python setup.py test

Test a specific feature:

  • Message

    $ python setup.py -s synapses.tests.test_message

  • All Node features

    $ python setup.py -s synapses.tests.test_node

  • Node zmq tests

    $ python setup.py -s synapses.tests.test_node.ZMQTestCase

To test the code coverage
( you need nose, use last version from http://pypi.python.org/pypi/nose )
$ python setup.py nosetests

python-synapse's People

Contributors

ggreg avatar zllak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-synapse's Issues

zmq.poll in pyzmq>2.0.10.1 is now raising the EINTR

zmq.poll does not anymore handle the EINTR returned by poll() in version pyzmq>2.0.10.1.
Two options:

  • this can be a bug in pyzmq, maybe they still want to catch the EINTR to keep the old behavior
  • we need to catch the EINTR on our side

zmq.poll fail when the timeout is too large

The zmq.poll methods fails when the timeout is too large.

Exception is:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/gevent/greenlet.py", line 405, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.6/dist-packages/synapse/node.py", line 688, in loop
    cont = self.poll()
  File "/usr/local/lib/python2.6/dist-packages/synapse/node.py", line 752, in poll
    actives = self._poller.poll(polling_timeout_ms)
  File "_zmq.pyx", line 1061, in zmq._zmq.Poller.poll (zmq/_zmq.c:8087)
  File "_zmq.pyx", line 942, in zmq._zmq._poll (zmq/_zmq.c:6986)
OverflowError: long int too large to convert to int
<Greenlet at 0x9f71e2c: <bound method ZMQPoller.loop of <synapse.node.ZMQPoller object at 0x9fe8a2c>>> failed with OverflowError

Fails with values: 86400, 3600.
Works with 1800.

But this fairly low value is strange cause it seems to overflow when converting from long to integer, and even if the value (given in seconds) is converted in milliseconds, it would fit into an integer.
If the value is converted in microseconds, it can explain the overflow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.