{ "info": { "author": "Cameron Simpson", "author_email": "cs@cskk.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: System :: Networking" ], "description": "*Latest release 20191004*:\nPacketConnection: new optional parameter `packet_grace` to tune the send delay for additional packets before a flush, default DEFAULT_PACKET_GRACE (0.01s), 0 for no delay.\nAdd a crude packet level activity ticker.\n\nA general purpose bidirectional packet stream connection.\n\n## Class `Packet`\n\nMRO: `cs.binary.PacketField`, `abc.ABC` \nA protocol packet.\n\n## Class `PacketConnection`\n\nA bidirectional binary connection for exchanging requests and responses.\n\n### Method `PacketConnection.__init__(self, recv, send, request_handler=None, name=None, packet_grace=None, tick=None)`\n\nInitialise the PacketConnection.\n\nParameters:\n* `recv`: inbound binary stream.\n If this is an `int` it is taken to be an OS file descriptor,\n otherwise it should be a `cs.buffer.CornuCopyBuffer`\n or a file like object with a `read1` or `read` method.\n* `send`: outbound binary stream.\n If this is an `int` it is taken to be an OS file descriptor,\n otherwise it should be a file like object with `.write(bytes)`\n and `.flush()` methods.\n For a file descriptor sending is done via an os.dup() of\n the supplied descriptor, so the caller remains responsible\n for closing the original descriptor.\n* `packet_grace`:\n default pause in the packet sending worker\n to allow another packet to be queued\n before flushing the output stream.\n Default: `DEFAULT_PACKET_GRACE`s.\n A value of `0` will flush immediately if the queue is empty.\n* `request_handler`: an optional callable accepting\n (`rq_type`, `flags`, `payload`).\n The request_handler may return one of 5 values on success:\n * `None`: response will be 0 flags and an empty payload.\n * `int`: flags only. Response will be the flags and an empty payload.\n * `bytes`: payload only. Response will be 0 flags and the payload.\n * `str`: payload only. Response will be 0 flags and the str\n encoded as bytes using UTF-8.\n * `(int, bytes)`: Specify flags and payload for response.\n An unsuccessful request should raise an exception, which\n will cause a failure response packet.\n* `tick`: optional tick parameter, default `None`.\n If `None`, do nothing.\n If a Boolean, call `tick_fd_2` if true, otherwise do nothing.\n Otherwise `tick` should be a callable accepting a byteslike value.\n\n## Class `Request_State`\n\nMRO: `builtins.tuple` \nRequestState(decode_response, result)\n\n## Function `tick_fd_2(bs)`\n\nA low level tick function to write a short binary tick\nto the standard error file descriptor.\n\nThis may be called by the send and receive workers to give\nan indication of activity type.\n\n\n\n# Release Log\n\n*Release 20191004*:\nPacketConnection: new optional parameter `packet_grace` to tune the send delay for additional packets before a flush, default DEFAULT_PACKET_GRACE (0.01s), 0 for no delay.\nAdd a crude packet level activity ticker.\n\n*Release 20190221*:\nDISTINFO requirement updates.\n\n*Release 20181228*:\nInitial PyPI release.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all", "keywords": "python2,python3", "license": "GNU General Public License v3 or later (GPLv3+)", "maintainer": "", "maintainer_email": "", "name": "cs.packetstream", "package_url": "https://pypi.org/project/cs.packetstream/", "platform": "", "project_url": "https://pypi.org/project/cs.packetstream/", "project_urls": { "Homepage": "https://bitbucket.org/cameron_simpson/css/commits/all" }, "release_url": "https://pypi.org/project/cs.packetstream/20191004/", "requires_dist": null, "requires_python": "", "summary": "general purpose bidirectional packet stream connection", "version": "20191004" }, "last_serial": 5927744, "releases": { "20181228": [ { "comment_text": "", "digests": { "md5": "ec19f12ae1ed7647ee385ad1863da15a", "sha256": "45c6fa8d9e29d2a45397b4a3f4d001803144cefc2e8ff2cbef7b97650c517593" }, "downloads": -1, "filename": "cs.packetstream-20181228.tar.gz", "has_sig": false, "md5_digest": "ec19f12ae1ed7647ee385ad1863da15a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7068, "upload_time": "2018-12-28T09:40:03", "url": "https://files.pythonhosted.org/packages/10/d4/4c4224a48f4925b77e7ba5aadaa05df909c2f960f7c80c57b367c179fb4e/cs.packetstream-20181228.tar.gz" } ], "20190221": [ { "comment_text": "", "digests": { "md5": "3bd2aff53918707ff7a32447eac098bf", "sha256": "0d0e5196c08069e6172833009563c715c566e80ecd00f34d13bc2ea655b3b268" }, "downloads": -1, "filename": "cs.packetstream-20190221.tar.gz", "has_sig": false, "md5_digest": "3bd2aff53918707ff7a32447eac098bf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7191, "upload_time": "2019-02-21T09:05:11", "url": "https://files.pythonhosted.org/packages/1e/bf/9151dbfb0e1b3c82363ec399009b0470d060f6cab809371e9292323f3027/cs.packetstream-20190221.tar.gz" } ], "20191004": [ { "comment_text": "", "digests": { "md5": "df3ad0c3ef79587d02cd3a6310a1a6dc", "sha256": "12679ef9ca762a5d5a63e0e9616e22c5ecf6e50a5c1b44779003d81d29cfb7f5" }, "downloads": -1, "filename": "cs.packetstream-20191004.tar.gz", "has_sig": false, "md5_digest": "df3ad0c3ef79587d02cd3a6310a1a6dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8682, "upload_time": "2019-10-04T10:34:08", "url": "https://files.pythonhosted.org/packages/dd/14/b7613677311a443f4dab882a635b43aed06608f9555b5be65f866cd9cd3b/cs.packetstream-20191004.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df3ad0c3ef79587d02cd3a6310a1a6dc", "sha256": "12679ef9ca762a5d5a63e0e9616e22c5ecf6e50a5c1b44779003d81d29cfb7f5" }, "downloads": -1, "filename": "cs.packetstream-20191004.tar.gz", "has_sig": false, "md5_digest": "df3ad0c3ef79587d02cd3a6310a1a6dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8682, "upload_time": "2019-10-04T10:34:08", "url": "https://files.pythonhosted.org/packages/dd/14/b7613677311a443f4dab882a635b43aed06608f9555b5be65f866cd9cd3b/cs.packetstream-20191004.tar.gz" } ] }