{ "info": { "author": "Mischa Spiegelmock", "author_email": "revmischa@cpan.org", "bugtrack_url": null, "classifiers": [], "description": "[![Build Status](https://travis-ci.org/revmischa/socketio_pg.svg?branch=master)](https://travis-ci.org/revmischa/socketio_pg)\n\nSocketIO PostgreSQL PubSub Websocket Server\n================\n\n# What Is This?\nThis is a websocket server that uses PostgreSQL as its message transport system.\n\nIf you have an application that already uses postgres, you can easily send and receive asynchronous events via your existing database. Check out the [postgres documentation on LISTEN/NOTIFY](https://www.postgresql.org/docs/current/static/sql-notify.html) for more details.\n\n# How Do I Use This?\n\n## Server\n\n### Configuration\nFirst configure a database connection string in `DATABASE_URL`.\nYou can create a `local.cfg`:\n```\n# local.cfg\nSQLALCHEMY_DATABASE_URI = 'postgresql:///mydatabase\nDEBUG = True\n```\nOr set `DATABASE_URL` in your environment. If you use Heroku and have a database attached, this will be set already.\n\n### Prerequisites\nNote: python 3.6 or higher is required.\n`pip install -r requirements.txt`\n\n### Run\n* Debug server mode: `DEBUG=1 python socketio_pg/server.py`\n* In gunicorn (production): `gunicorn --worker-class eventlet -w 1 socketio_pg.server:app`\n* If using Heroku, a Procfile is already set up for you.\n\n## Client\n\nOn the client side, you simply connect a [socket.io client](https://socket.io/docs/client-api/) to begin sending and receiving events.\nThere's a simple demo HTML page at [socketio_pg/static/test.html](socketio_pg/static/test.html) that you can access from the dev server at [http://localhost:3030/static/test.html](http://localhost:3030/static/test.html).\n\n# Why Use This?\nIf your application already uses PostgreSQL, you can start sending and receiving asynchronous events right away. It makes an excellent transport for messages (keep them small though, under 8000 bytes), and you can simply issue queries to do it. No additional infrastructure needed, besides this websocket server. If you aren't using PostgreSQL, [maybe you should be](https://spiegelmock.com/2014/10/19/mysql-vs-postgresql-and-why-you-care/).\n\nOne neat trick is to set up triggers that emit `NOTIFY` queries when rows on certain tables are inserted or updated. This allows messages to be delivered to clients notifying them of updates without any application code at all. Some demos and slides from a talk can be found [here](https://github.com/revmischa/pgnotify-demos).\n\n# In Action\n![socketio_pg in action](https://raw.githubusercontent.com/revmischa/socketio_pg/master/screenshot.png)\n\n# How Is This Built?\nThis server uses the following technologies:\n* Flask - python web microframework\n* psycopg2 - postgresql driver\n* [eventlet](http://eventlet.net/) - lightweight green threading library\n* [greenlet](https://greenlet.readthedocs.io/en/latest/) - app threads in python\n* socket.io - client and server layer on top of websockets to handle namespacing, reconnection, and basic session management", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/revmischa/socketio_pg", "keywords": "websocket pubsub socketio socket.io greenlet eventlet postgresql postgres psycopg2 server", "license": "ABRMS", "maintainer": "", "maintainer_email": "", "name": "socketio-pg", "package_url": "https://pypi.org/project/socketio-pg/", "platform": "", "project_url": "https://pypi.org/project/socketio-pg/", "project_urls": { "Homepage": "http://github.com/revmischa/socketio_pg" }, "release_url": "https://pypi.org/project/socketio-pg/0.13/", "requires_dist": null, "requires_python": "", "summary": "Websocket server using PostgreSQL as a message transport. Uses SocketIO, Greenlet, Flask.", "version": "0.13" }, "last_serial": 4769145, "releases": { "0.10": [ { "comment_text": "", "digests": { "md5": "bc9373e8e75e713d3ecc1eef197b240d", "sha256": "6686d6172ed6e07dc7abdfac648c8900a8c13d3242a9927c52e7c7721d375d6f" }, "downloads": -1, "filename": "socketio_pg-0.10.tar.gz", "has_sig": false, "md5_digest": "bc9373e8e75e713d3ecc1eef197b240d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7841, "upload_time": "2018-10-08T10:02:43", "url": "https://files.pythonhosted.org/packages/be/24/7351a9cccc31a1d2dbe51720dcb3e3ef050fceca1578cb39c93e80cc2c9a/socketio_pg-0.10.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "b8ae03fa9b0ba549b351e9ba901a0520", "sha256": "5fdc4559df98fe4473b570e43284b161d4a4500c071a87cb5bfda9d7797ed74e" }, "downloads": -1, "filename": "socketio_pg-0.11.tar.gz", "has_sig": false, "md5_digest": "b8ae03fa9b0ba549b351e9ba901a0520", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8110, "upload_time": "2018-10-08T10:38:44", "url": "https://files.pythonhosted.org/packages/5d/99/7b2d7a35b2d0b92a0fcfe30040b446026e756d6647e4e005982e71fda25b/socketio_pg-0.11.tar.gz" } ], "0.13": [ { "comment_text": "", "digests": { "md5": "e31b663333b69b1c67e2cc04d6bc213d", "sha256": "7c6249c453307067cc74f761662fc8653144d3906bc37537da1bf27cd8038549" }, "downloads": -1, "filename": "socketio_pg-0.13.tar.gz", "has_sig": false, "md5_digest": "e31b663333b69b1c67e2cc04d6bc213d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7692, "upload_time": "2019-02-01T16:55:57", "url": "https://files.pythonhosted.org/packages/8d/1e/57f25325c80c44f35a0cec9f2f31778043fc52b7917caff0aeb003a9cad4/socketio_pg-0.13.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "c18063f4e72f2fafc54eed8296cee1fb", "sha256": "912ff313b653af9b7241fa7b29ce34207ef8b423d68cec0fbeb237554d78944f" }, "downloads": -1, "filename": "socketio_pg-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "c18063f4e72f2fafc54eed8296cee1fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8327, "upload_time": "2018-05-21T21:48:03", "url": "https://files.pythonhosted.org/packages/c6/47/d6cbc18bac32ec416ecb424b2989be63364c2350d735e8cc7c8819b52c25/socketio_pg-0.3-py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a427c476a93c5a405b7ce43576f8b3e3", "sha256": "ba57b195d42e80041193636bf92edfa8341abb9a0afc96fabf6884e447cfa233" }, "downloads": -1, "filename": "socketio_pg-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a427c476a93c5a405b7ce43576f8b3e3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8347, "upload_time": "2018-05-21T21:56:24", "url": "https://files.pythonhosted.org/packages/4a/43/3d8664fcd6552bc80e3c0fc8d2ffbdde79b326dfcbd0ec9b0696b819fb47/socketio_pg-0.4-py3-none-any.whl" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "c78bb44f34262b08f015d2918d9e0f02", "sha256": "558769ecdff241723ea6aa02488611a4c35ac62ed5c06720511ef7114025c1f4" }, "downloads": -1, "filename": "socketio_pg-0.5.tar.gz", "has_sig": false, "md5_digest": "c78bb44f34262b08f015d2918d9e0f02", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6951, "upload_time": "2018-05-22T11:59:34", "url": "https://files.pythonhosted.org/packages/05/08/1c282cdaa8b78880359bdd4e5117af9c9839972e60ce10b0474ee919d940/socketio_pg-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "a1568efc1c545c1c2baa6eddedeb682a", "sha256": "365942d98873a7c77f0b75cf33a3f5bbf1b0d2321f2a03151d72c403adab10a8" }, "downloads": -1, "filename": "socketio_pg-0.6.tar.gz", "has_sig": false, "md5_digest": "a1568efc1c545c1c2baa6eddedeb682a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7469, "upload_time": "2018-05-22T12:08:47", "url": "https://files.pythonhosted.org/packages/9e/40/b5ee1821c661d45f4e9ecd9dea5c20ac82cebb30e8ea50cdb7184b7dd29d/socketio_pg-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "56c44520f561525fd4dad44fb8d4f2c0", "sha256": "90b49e597ce8ca13dc8236632e49d50a35a85a98f0c43c340e4211f0066c2f8d" }, "downloads": -1, "filename": "socketio_pg-0.7.tar.gz", "has_sig": false, "md5_digest": "56c44520f561525fd4dad44fb8d4f2c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7809, "upload_time": "2018-05-22T12:13:34", "url": "https://files.pythonhosted.org/packages/81/d1/6b8b64fccf3c84d55cb6137a8d1216b31f997b327dcad1b4391458af6ef9/socketio_pg-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "e3182c4704da883d9c322dea366f20d6", "sha256": "a8154a5871291d16cfec5b553d47c9ff76e7a92e549d382fd8870088eece718e" }, "downloads": -1, "filename": "socketio_pg-0.8.tar.gz", "has_sig": false, "md5_digest": "e3182c4704da883d9c322dea366f20d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7498, "upload_time": "2018-05-22T12:40:30", "url": "https://files.pythonhosted.org/packages/8a/a4/1b928d23e35bb189901d9903dfa81b70c4bda797efe0f34af5c78aca3ebd/socketio_pg-0.8.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "eef105d9384fd62a240ac4ababd5dc4d", "sha256": "7616a9150b613fd2bfa26dbbb55eee25bac3ea8ee24aa2155c0380e66ca9f836" }, "downloads": -1, "filename": "socketio_pg-0.9.tar.gz", "has_sig": false, "md5_digest": "eef105d9384fd62a240ac4ababd5dc4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7839, "upload_time": "2018-10-08T09:56:06", "url": "https://files.pythonhosted.org/packages/b0/5e/39068f94cc8e6c04671b412f5b242071c45c14f1438ef2d67ad5013c743c/socketio_pg-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e31b663333b69b1c67e2cc04d6bc213d", "sha256": "7c6249c453307067cc74f761662fc8653144d3906bc37537da1bf27cd8038549" }, "downloads": -1, "filename": "socketio_pg-0.13.tar.gz", "has_sig": false, "md5_digest": "e31b663333b69b1c67e2cc04d6bc213d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7692, "upload_time": "2019-02-01T16:55:57", "url": "https://files.pythonhosted.org/packages/8d/1e/57f25325c80c44f35a0cec9f2f31778043fc52b7917caff0aeb003a9cad4/socketio_pg-0.13.tar.gz" } ] }