Skip to content

niamtokik/pgq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgq

An Erlang library to use pgq postgresql extension.

This project was created to understand pgq and how to study queueing systems on PostgreSQL. pgq application should not be used in production for the moment.

Build

rebar3 compile

Installation and Boostrap

Download and install pgq postgresql extension.

git clone https://github.com/pgq/pgq
make 
make install

Create a new database (or use an existing one) and enable the extension.

CREATE DATABASE my_database;
\c my_database
CREATE EXTENSION pgq;

Usage

Main Interface

TODO

Low Level Interface

% Requires an active and valid epgsql connection.
{ok, C} = epgsql:connect(Args).

% check if pgq is installed.
true = pgq_low:is_installed(C).

% check the version
{ok, Version} = pgq_low:version(C).

% create a queue
{ok, _} = pgq_low:create_queue(C, "new_queue").

% insert data
{ok, _} = pgq_low:insert_event(C, "new_queue", "event_type", "event_value").

Producer Process

TODO

Consumer Process

TODO

PubSub Pattern

TODO

Topics Pattern

TODO

Routing Pattern

TODO

RPC Pattern

TODO

References and Resources

pgq official documentation

pgq official repository