I created this project to test how the pq (Simple transactional queue for PostgreSQL written in Python) library works and how I can create jobs directly from sql queries and not only via Python.
- Docker
- Python 3
- Poetry:
$ pip install poetry
$ poetry install
$ docker-compose up -d
In a first terminal, start:
$ poetry run ./server.py
In a second terminal, start another server:
$ poetry run ./server.py
In a third terminal, create a job:
$ poetry run ./create-a-job.py
You can also create a job via PostreSQL console:
$ ./scripts/enter-in-pg.sh
postgres=# INSERT INTO queue (q_name, data) VALUES('queue1', '{"foo": "bar2"}');
INSERT 0 1
postgres=#