{ "info": { "author": "Walter Moreira", "author_email": "walter@waltermoreira.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "=========\nChannelPy\n=========\n\nA basic implementation of Go_ inspired channels.\n\nUse these channels to communicate across Python threads, processes, or\nhosts, independent of network location. Channels are first class\nobjects that can be passed themselves through the channels.\n\nThe current implementation uses RabbitMQ_ as a broker, but it can be\nswapped by other queues or even a peer-to-peer transport mechanism\nsuch as ZeroMQ_. See `the implementation details`_.\n\n\nPrerequisite\n============\n\nStart a RabbitMQ instance by executing the following command in the\nroot directory of this repository:\n\n.. code-block:: bash\n\n docker-compose up -d\n\n\nQuickstart\n==========\n\n- Create a channel with:\n\n .. code-block:: python\n\n >>> from channelpy import Channel\n >>> ch = Channel()\n\n- Put and get objects to and from the channel:\n\n .. code-block:: python\n\n >>> ch.put('foo')\n >>> ch.get()\n 'foo'\n >>> ch.get(timeout=1)\n # raises ChannelTimeoutException since channel is empty\n\n- Pass channels into channels:\n\n .. code-block:: python\n\n >>> ch1 = Channel()\n >>> ch1.put(5)\n >>> ch2 = Channel()\n >>> ch2.put(ch1)\n >>> x = ch2.get()\n >>> x.get()\n 5\n\n- Channels can be instantiated by name:\n\n .. code-block:: python\n\n >>> ch = Channel()\n >>> ch.name\n 'daa0a490f9254c69883335c9f925d74f'\n >>> another = Channel(name=ch.name)\n >>> another.put('foo')\n >>> ch.get()\n 'foo'\n\n Or create them with a specific name:\n\n .. code-block:: python\n\n >>> ch = Channel(name='my_channel')\n\n- Multiple consumers and producers can be attached to a\n channel. Messages are delivered in round-robin fashion to\n consumers. However, a ``close_all`` can be delivered to all the\n consumers to signal a full termination of the channel.\n\n .. code-block:: python\n\n >>> ch = Channel()\n >>> def f(c):\n ... while True:\n ... print(c.get())\n ...\n >>> threading.Thread(target=f, args=(ch,)).start()\n >>> threading.Thread(target=f, args=(ch,)).start()\n >>> ch.put(4) # one of the threads will print 4\n >>> ch.close_all() # ChannelClosedException is raised in all threads\n\n- The broker to use can be configured at instantiation time or by\n using the config file ``~/.channelpy.yml``. For example:\n\n .. code-block:: YAML\n\n connection: RabbitConnection\n uri: amqp://192.168.35.10:5672\n\n\n\nTests\n=====\n\nRun the tests with:\n\n.. code-block:: bash\n\n $ BROKER='amqp://localhost:5672' py.test -v\n\n\n.. _implementation_details:\n\nImplementation Details\n======================\n\nTo be written.\n\n\n.. _Go: http://golang.org/\n.. _ZeroMQ: http://zeromq.org/\n.. _RabbitMQ: http://www.rabbitmq.com/\n.. _the implementation details: #implementation-details", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/waltermoreira/channelpy", "keywords": "channels distributed queues", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "channelpy", "package_url": "https://pypi.org/project/channelpy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/channelpy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/waltermoreira/channelpy" }, "release_url": "https://pypi.org/project/channelpy/0.2/", "requires_dist": null, "requires_python": null, "summary": "Go Inspired Channels", "version": "0.2" }, "last_serial": 1648825, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "9f847a6d7058e3553d4bc311b06ea41a", "sha256": "ff426acbd6df8ef71e33f0d502384280857228978aede38539c7c012c5a5a050" }, "downloads": -1, "filename": "channelpy-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9f847a6d7058e3553d4bc311b06ea41a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9309, "upload_time": "2015-07-24T22:23:25", "url": "https://files.pythonhosted.org/packages/b7/d5/bbf12d3c3fcd7202537fc79580a00ac9451260cbfb64acd64ee6e81c1bcc/channelpy-0.2-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f847a6d7058e3553d4bc311b06ea41a", "sha256": "ff426acbd6df8ef71e33f0d502384280857228978aede38539c7c012c5a5a050" }, "downloads": -1, "filename": "channelpy-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9f847a6d7058e3553d4bc311b06ea41a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9309, "upload_time": "2015-07-24T22:23:25", "url": "https://files.pythonhosted.org/packages/b7/d5/bbf12d3c3fcd7202537fc79580a00ac9451260cbfb64acd64ee6e81c1bcc/channelpy-0.2-py2.py3-none-any.whl" } ] }