Skip to main content

Python event framework using PostgreSQL listen/notify

Project description

pgevents

Build Status Coverage Status Code style: black

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


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 details)

Uploaded Source

Built Distribution

pgevents-0.0.12-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file pgevents-0.0.12.tar.gz.

File metadata

  • Download URL: pgevents-0.0.12.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

Hashes for pgevents-0.0.12.tar.gz
Algorithm Hash digest
SHA256 5d23488f8bee7217ce42839b770e05579f78507362bcb68db5957e4b743e7aa5
MD5 b69efde53a22d819a678727eff4c28ce
BLAKE2b-256 d8001d23defc07c53480bdcc79c8130e4493ff639f2ac5418953c9dbc63233c7

See more details on using hashes here.

File details

Details for the file pgevents-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: pgevents-0.0.12-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

Hashes for pgevents-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e63a6eeaf09b8fdd737c9082f7d81011f80349fec1487c5440d18d2020e151b2
MD5 ec8f345457809f967cff7ea3017af85b
BLAKE2b-256 0b6f3864e9100c8163f97e8ab2d9176723c299fb4220f3135b1f72df615e20b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page