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.12.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for pgevents-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63a6eeaf09b8fdd737c9082f7d81011f80349fec1487c5440d18d2020e151b2 |
|
MD5 | ec8f345457809f967cff7ea3017af85b |
|
BLAKE2b-256 | 0b6f3864e9100c8163f97e8ab2d9176723c299fb4220f3135b1f72df615e20b0 |