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.6.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file pgevents-0.0.6.tar.gz
.
File metadata
- Download URL: pgevents-0.0.6.tar.gz
- Upload date:
- Size: 5.1 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 | 836829e3f06718bb151dc5eb7928a8bf873a9f2a580068684d19ad6107cd4450 |
|
MD5 | 5cbfa861255b6ca350c81743438986f5 |
|
BLAKE2b-256 | 6360b1ddb4e2ba9e3cc99ab153fd6db01440619eccd1de19e3b0feaeca342019 |
File details
Details for the file pgevents-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: pgevents-0.0.6-py3-none-any.whl
- Upload date:
- Size: 8.9 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 | 6c53766f03e860d76f9b4e6dd62c110888b5bfb8b43b0c94aa291bb8e0388b31 |
|
MD5 | 8437b9d7f7504daef9a4b1c4f0ac8e6e |
|
BLAKE2b-256 | 4080a54b8cb015db8c155db1cd1a987ea428421b8d290b327df8b6b64203251c |