Python event framework using PostgreSQL listen/notify
Project description
pgevents
Python event framework using PostgreSQL listen/notify
Example Usage
from pgevents import App
dsn = "dbname=test user=test password=test host=localhost"
channel = "foo" # Postgres channel to listen for notifications on
topic = "bar" # Event topic for handler to respond to
app = App(dsn, channel)
@app.register(topic)
def handler(context):
print("Handling event")
app.run()
Create an event entry
INSERT INTO events (topic)
VALUES('bar');
Then send a notification by running the following SQL:
NOTIFY foo;
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pgevents-0.0.8.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file pgevents-0.0.8.tar.gz
.
File metadata
- Download URL: pgevents-0.0.8.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ab87a229f582aac85a98e977c4ac8c88ca52f5259024734668e204fabb54e6 |
|
MD5 | 6dcb8334de75ce79360e1b398f8bcc50 |
|
BLAKE2b-256 | ad8d90c9cccd36787057edfac2576a0aca0fc0635d18fe4dabf4f32308fa5ce6 |
File details
Details for the file pgevents-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: pgevents-0.0.8-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0028e41ee1af0a59dcfc4c758fc6f681d07a642ac58fd662bf60f3955b162fa7 |
|
MD5 | 400051ec0a76c04058ec37f45a61f5e9 |
|
BLAKE2b-256 | a76a47bbdc5c7c0ac4409fd021095791b8b63f5ca1f56c67464934b4089a1595 |