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.10.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for pgevents-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64cab01bf0d8d7a5749ccb829999639507c4afbf3af42b85841844435def9af3 |
|
MD5 | 21b53c3acca146601c88f9ff0acfc765 |
|
BLAKE2b-256 | 1726bbb10dd5baff4b172a1afe1c0d07cb84beeb87b6fc0b5b527784ec10b76f |