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.11.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file pgevents-0.0.11.tar.gz
.
File metadata
- Download URL: pgevents-0.0.11.tar.gz
- Upload date:
- Size: 5.6 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.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104a1810b49ace0459832980eac549a7e6087c44d35b5bde6260136ce77f0b69 |
|
MD5 | 436a8f5fea3b697ba176c1d97859abf3 |
|
BLAKE2b-256 | 395cf74389e315f5d119967b14788af873a32c467caca2dda2178cc40cb29a7c |
File details
Details for the file pgevents-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: pgevents-0.0.11-py3-none-any.whl
- Upload date:
- Size: 9.6 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.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c7fba5a4a5e8178d30b8da12496b3224438f77e260119dd5b25942fffc96088 |
|
MD5 | 43daa5d14757a09599df2d1331bab3fd |
|
BLAKE2b-256 | 9666ac1e086da32eca9ef11206625601281a80c8c90aa5a757c4ebb719db4d9f |