A Python solution using uvloop and asyncpg. See README for problem description. The recommended python version is 3.6.x.
$ docker volume create rent_slogan
$ docker run \
-v rent-slogan:/var/lib/postgresql/data \
-e POSTGRES_PASSWORD=1234 \
-e POSTGRES_DB=rent_slogan \
-p 5432:5432 \
-d postgres:9.6-alpine
$ python3 -m venv ~/.venv/ras
$ source ~/.venv/ras/bin/activate
# for just running the project
$ pip install -r requirements.txt
# for running tests and code quality checks
$ pip install -r test/requirements.txt
$ python -m server
$ nc localhost 25001
status
Total number of slogans: 10
Number of rents: 2
Number of connected clients: 3
add::Just do it
Just do it
add::Just do it
error: slogan already exists
rent
OK: id:4 title:t1
Slogan id 4 has expired
py.test