Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rgrinberg/ebqueue
- Owner: rgrinberg
- Created: 2014-12-31T04:01:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-08T00:04:38.000Z (almost 10 years ago)
- Last Synced: 2024-05-01T23:52:09.339Z (6 months ago)
- Language: Erlang
- Size: 160 KB
- Stars: 8
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-erlang - ebqueue - Tiny simple blocking queue in erlang. (Queue)
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.
```