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.5.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgevents-0.0.5-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pgevents-0.0.5.tar.gz
  • Upload date:
  • Size: 5.0 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.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.7

File hashes

Hashes for pgevents-0.0.5.tar.gz
Algorithm Hash digest
SHA256 45ce384cc3d019ca1975c99bec0c84d1d1cdcc45fcad8b220500582e8b152974
MD5 757f5caf6775b3adb7c5b21b9cc11a75
BLAKE2b-256 3380fd8ad134216ccf03d399dcd843e5940eaec8a792e8036b86e86e376f2729

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pgevents-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.4 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.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.7

File hashes

Hashes for pgevents-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 41305a639df1844fe25ba26fe2a75b57bb45761f21e8bd9a3edd45d90448c501
MD5 6715f1a533806fa9e76033f8d12779d1
BLAKE2b-256 48e113b6e30ecc1dc6aacec8240c321c06461906462fbab9834f6f9237f4ec06

See more details on using hashes here.

Supported by

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