Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niamtokik/pgq
Erlang interface to pgq
https://github.com/niamtokik/pgq
database epgsql erlang pgq postgresql queue queuing
Last synced: 27 days ago
JSON representation
Erlang interface to pgq
- Host: GitHub
- URL: https://github.com/niamtokik/pgq
- Owner: niamtokik
- License: mit
- Created: 2024-02-10T21:01:16.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-02-13T18:53:40.000Z (9 months ago)
- Last Synced: 2024-09-30T03:41:47.503Z (about 1 month ago)
- Topics: database, epgsql, erlang, pgq, postgresql, queue, queuing
- Language: Erlang
- Homepage: https://github.com/niamtokik/pgq
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pgq
An Erlang library to use [pgq](https://pgq.github.io/extension/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
```erlang
rebar3 compile
```## Installation and Boostrap
Download and install pgq postgresql extension.
```sh
git clone https://github.com/pgq/pgq
make
make install
```Create a new database (or use an existing one) and enable the
extension.```sql
CREATE DATABASE my_database;
\c my_database
CREATE EXTENSION pgq;
```## Usage
### Main Interface
TODO
### Low Level Interface
```erlang
% 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](https://pgq.github.io/extension/pgq)
[pgq official repository](https://github.com/pgq/pgq)