Skip to content

Instantly share code, notes, and snippets.

View k-piekarczyk's full-sized avatar
🧯
¯\_(ツ)_/¯

Krzysztof Piekarczyk k-piekarczyk

🧯
¯\_(ツ)_/¯
View GitHub Profile
@kissgyorgy
kissgyorgy / listen.py
Created September 4, 2020 16:37
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@ksmithut
ksmithut / .dockerignore
Last active April 26, 2024 14:04
Node Docker Compose nodemon
node_modules