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.7.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file pgevents-0.0.7.tar.gz
.
File metadata
- Download URL: pgevents-0.0.7.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 | 62cbde6af6ea1c2e87cedd72ca81f1b5a6eef2375e4afa2a2e03955b0d43ca65 |
|
MD5 | 84c0f013056644734236c2c60a15cb85 |
|
BLAKE2b-256 | 8d80fb16c6f50c0ab14ba3f64828f1465b1f47b67be6cc9ac28415dea39ea479 |
File details
Details for the file pgevents-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: pgevents-0.0.7-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 | dfb28b1fefb686b6c66305d083edef62be0772d1d0b70a868babbd15f18765ee |
|
MD5 | 512e2c2d309a9fb67c3dbb5225a3047f |
|
BLAKE2b-256 | 6131ea1ca2d0b5c86bc3fd27393a4ee0af06022e3d93f135b35265101d1d1d37 |