{ "info": { "author": "Erik van Zijst", "author_email": "erik.van.zijst@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: System :: Clustering", "Topic :: System :: Distributed Computing", "Topic :: System :: Filesystems" ], "description": "=================================\nVSQS: Very Simple Queueing System\n=================================\n\nVSQS is a message queuing system that is inspired on Amazon's SQS API, uses\nthe file system as persistent storage and does not require active broker\ndaemons.\n\nMessage delivery is strictly FIFO. Consumed messages must explicitly be deleted\nto prevent automatic requeuing.\n\n\nFile State Transitions\n----------------------\n\nEach queue is represented by a directory on the file system. All messages on a\nqueue are individual files within this directory. There is no queue nesting.\n\nMessages are stored as individual files that transition through the following\nstate diagram from creation to deletion.\n\nFile names are the millisecond unix timestamp of creation, followed by an\noptional extension to indicate the file's current state. Transitions between\nstates are implemented as atomic file system operations so that multiple\nprocesses can safely use a shared queue.\n\n\nNew\n---\n\nWhen a new message is published a new file is created whose name is the current\nunix timestamp with the extension ``.new`` (e.g. ``1415776871123.new``).\n\nFiles are created atomically: ``open(fn, O_CREAT|O_EXCL|O_WRONLY)``\n\nIf creation fails because a concurrent process just wrote a message at the\nexact same time, the publisher enters a retry loop, updating the file name with\nthe current time, until it succeeds.\n\nIf the call is successful, the client then performs a directory listing to\ncheck for the presence of files with the same name, but with an extension. If\none is found, that indicates the existence of a message that was published at\nthe same time, but is currently in a different state. To avoid clashes, the\nclient then deleted it temporary files and loops back.\n\nOnly once a new file is successfully created and there are no other files with\nthe same timestamp in their filename can the message's payload be written to\nthe new file, after which the file is closed and moved into its final\ndestination by dropping the .new extension.\n\n\nReady\n-----\n\nFiles without extension are ready for consumption. Queues are FIFO and so to\nconsume a message a client performs a directory listing, orders the file names\nnumerically (\"99\" comes before \"100\"), ignores all files that have extensions\nand selects the oldest message.\n\nTo consume the message, the client then renames the file by adding the\nexpiration time as extension to the file (e.g. ``1415776871123.1415776879654``).\n\nThe expiration file is calculated by adding the visibility timeout to the\ncurrent time and expressing it as another unix timestamp with millisecond\nprecision.\n\nThe message is now marked as being in the processes of getting consumed. No\nother consumer will touch the message.\n\nIf renaming failed it indicates a race with another client. Just loop back in\nand select the next message.\n\nMessages are returned to the user application accompanied by their unique\nmessage id. This id can be their filename (minus any extensions).\n\n\nDeleted\n-------\n\nWhen a consumer is done processing a message they must actively delete it by\nspecifying its id.\n\nTo delete a message, vsqs then performs a directory listing, looking for files\nwith that name, regardless of extension. This should match zero or one file\nwhich is then deleted.\n\n\nRequeuing\n---------\n\nVsqs uses visibility timeouts similar to SQS. Visibility timeouts essentially\nhide messages while they're being processed. If a client dies during\nprocessing, the message will be placed back in the queue after its visibility\ntimeout expires.\n\nRequeuing is a synchronous process performed by vsqs consumers while waiting\nfor new messages to consume.\n\nAfter performing a directory listing, but before dequeuing the next message\nfrom the queue, a consumer looks for message files that have a visibility\ntimeout extension that lies in the past (indicating expiration). For each one\nfound, the client then requeues it by simple dropping the extension from the\nfile name (implemented as an atomic rename operation). ``ENOENT`` failures\nindicate a race and can safely be ignored.\n\nAfter requeuing vsqs loops back, does a new directory listing and starts over.\nOnly when there are no more expired messages can the next message be consumed.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/erikvanzijst/vsqs/archive/0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/erikvanzijst/vsqs", "keywords": "mq broker message queue", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "vsqs", "package_url": "https://pypi.org/project/vsqs/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/vsqs/", "project_urls": { "Download": "https://github.com/erikvanzijst/vsqs/archive/0.3.tar.gz", "Homepage": "https://github.com/erikvanzijst/vsqs" }, "release_url": "https://pypi.org/project/vsqs/0.3/", "requires_dist": null, "requires_python": null, "summary": "A very simple message queuing system inspired on Amazon's SQS.", "version": "0.3" }, "last_serial": 1325238, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "602b85289989636a398752c5cb063fe9", "sha256": "9d1ab070b5a4714501afca1e8236597ecb7795e9cc3addac56b0768371cb68f3" }, "downloads": -1, "filename": "vsqs-0.3.tar.gz", "has_sig": false, "md5_digest": "602b85289989636a398752c5cb063fe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6041, "upload_time": "2014-11-30T05:33:16", "url": "https://files.pythonhosted.org/packages/fe/91/2487b2d7a38c7992acc2c4fc3f67c9184f72cdddace7546c59083a7705de/vsqs-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "602b85289989636a398752c5cb063fe9", "sha256": "9d1ab070b5a4714501afca1e8236597ecb7795e9cc3addac56b0768371cb68f3" }, "downloads": -1, "filename": "vsqs-0.3.tar.gz", "has_sig": false, "md5_digest": "602b85289989636a398752c5cb063fe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6041, "upload_time": "2014-11-30T05:33:16", "url": "https://files.pythonhosted.org/packages/fe/91/2487b2d7a38c7992acc2c4fc3f67c9184f72cdddace7546c59083a7705de/vsqs-0.3.tar.gz" } ] }