Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rgrinberg/ebqueue

Tiny simple blocking queue in erlang
https://github.com/rgrinberg/ebqueue

Last synced: 3 months ago
JSON representation

Tiny simple blocking queue in erlang

Awesome Lists containing this project

README

        

# Ebqueue - Simplest Blocking Unbounded Queue in Erlang

## Usage

```
% create a queue
{ok, Q} = ebqueue:start_link().

% add some elements

ebqueue:in({xxx, 123}, Q).
ebqueue:in({yyy, 456}, Q).

% read from the queue
{ok, Element} = ebqueue:out(Q).

% read from queue with timeout
case ebqueue:out(Q, 1000) of
timeout -> io:format("Timed out.");
{ok, E} -> io:format("Got element ~p", [E])
end.
```