This project is a brief demo showing the use of PostgreSQL's LISTEN / NOTIFY feature to implement Pub / Sub.
$> make up build
docker-compose build
db uses an image, skipping
docker-compose up -d
Creating network "pgqueue_default" with the default driver
Creating pgqueue_db_1 ... done
PGPASSWORD=secret psql -U pgqueue -d pgqueue -h localhost -q -f sql/up.sql
go build -o build/listener listener/main.go
go build -o build/publisher publisher/main.go
$> make run-listener
go build -o build/listener listener/main.go
./build/listener
Start processing notifications, waiting for events...
$> make run-publisher
go build -o build/publisher publisher/main.go
./build/publisher
Received item.value: This is message #0
Received item.value: This is message #1
Received item.value: This is message #2
...
$> make clean down
Inspiration taken from PostgreSQL LISTEN/NOTIFY